Error running Cordova android platform - java

I'm trying to create my first cordova hybrid app. I run it with the "cordova browser" pratform and the app run fine. Now, when i try to build the app for android the console show me the next error :
$ cordova build android
ANDROID_HOME=C:\Users\MyUser\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_121
Unzipping C:\Users\MyUser\.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7 q9hj4ci1q\gradle-2.13-all.zip to C:\Users\MyUser\.gradle\wrapper\dists\gradle-2.1 3-all\7hsc6vr6mi3i6i5m7q9hj4ci1q
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipExceptio n: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java:65)
... 3 more
Error: cmd: Command failed with exit code 1 Error output:
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipExceptio n: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java:65)
... 3 more
Before, i was fixin others errors but with this, i don't know what i need to do. If a run the command "cordova requirements android" the console show that I have installed everything that I need.
The output for that command is the next:
$ cordova requirements android
Error loading cordova-browser
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed
Android target: installed android-14,android-16,android-18,android-22,android-23,android-24,android-25,Google Inc.:Google APIs:22,Google Inc.:Google APIs:23,Google Inc.:Google APIs:24
Gradle: installed
My project is on "React JS" and his libraries.

In your case, find this:
C:\Users\MyUser.gradle\wrapper\dists\gradle-2.13-
all\7hsc6vr6mi3i6i5m7
now when you find it,delete the gradle-2.2.1-all.zip because this file is corrupted and then we'll replace for this http://services.gradle.org/distributions/gradle-2.2.1-all.zip
when you finish all try again
cordova build android

Related

meteorjs when running on android-device im getting this error

I am trying to develop an app from meteor.js. I am able to compile and run on Apple devices. But when I try to run on android (meteor run android-device) I get the below error message from terminal. I have tried googling the issue but still could not get a fix!.
Status of the individual requirements:
✓ Java JDK
✓ Android SDK
✗ Android target: avdmanager: Command failed with exit code 1 Error output:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 5 more
✓ Gradle
This is what I did:
meteor remove-platform android
As mentioned by #SamaahRasheed I then went to Android Studio and updated it:
Android Studio > Check for updates
and then also updated everything else Android Studio then recommended I update as well.
Then I made sure JAVA_HOME was at least java 8
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
Then I re-added android platform:
meteor add-platform android
It may be that one of these was more important than the others, but this worked.

Failed with exit code 1 Error In cordova

C:\phoneGap\firstApp>cordova run android
ANDROID_HOME=C:\Android\sdk\
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_74 Unzipping C:\Users\Somnath Sarkar\.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7q9hj4ci1q\gradle-2.13-all.zip to C:\Users\Somnath Sarkar\.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7q9hj4ci1qException in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) ... 3 more
Error: cmd: Command failed with exit code 1 Error output: Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) ... 3 more
Delete "gradle-2.13-all.zip" folder and everything in this directory:
C:\Users\Somnath
Sarkar.gradle\wrapper\dists\gradle-2.13all\7hsc6vr6mi3i6i5m7q9hj4ci1q\
Download the gradle zip manually click here
Paste the gradle zip folder in
C:\Users\Somnath
Sarkar.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7q9hj4ci1q\
Run your
Codova build android
Caused by: java.util.zip.ZipException: error in opening zip file which means the concurrent ZIP file was Corrupted.
Solution :
Please Check the Zip file in C:\Users\YourUsername\.gradle\wrapper\dists\gradle-2.13-all\someRandomSting\ size and if it'size not equals to 66.6M then Download and Replace with this

Unable to convert to DEX format

I'm using Unity5, JDK 1.8 and I'm building for min android sdk = 10 and max = 22.
I can do a development build without any problems but when I'm trying to create an .apk file for the Google Play Store I get an error.
Error log:
CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
F:/Java/JDK\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="F:/Android/SDK\tools" -Dfile.encoding=UTF8 -jar "F:/Programs/Unity5/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
stderr[
UNEXPECTED TOP-LEVEL EXCEPTION:
java.util.zip.ZipException: zip file is empty
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:220)
at java.util.zip.ZipFile.<init>(ZipFile.java:150)
at java.util.zip.ZipFile.<init>(ZipFile.java:164)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:632)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at SDKMain.main(SDKMain.java:129)
1 error; aborting
]
And then a lot of lines that go like "processnig [path to .class file]".
I've tried switching to JDK 1.7 but to no avail.
I think I've eliminated the possibility of the multiple plugin error as there are no duplicate .jar's.
Any ideas what's causing this?
Solved!
For some reason the classes.jar file in the Unity program folder was corrupted, I replaced it with the one I had in my Android Studio project and now it works.
try this instead.
In my projects there were two androidAppCompact files were there 1.0.6 and 1.0.7. I deleted 1.0.6 and now its working fine

How to work with android studio for import and run project

I had download project from github and I want to import it into android studio. I tried several time but I cant run it. Any one give the step by step instruction to import the project because am new one for android studio.
Showing Error:
"C:\Program Files\Java\jdk1.8.0_25\bin\java" -ea -Didea.launcher.port=7532 -Didea.launcher.bin.path=D:\Users\SYS\AppData\Local\Android\android-studio\bin -Dfile.encoding=UTF-8 -classpath "D:\Users\SYS\AppData\Local\Android\android-studio\lib\idea_rt.jar;D:\Users\SYS\AppData\Local\Android\android-studio\plugins\junit\lib\junit-rt.jar;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\platforms\android-21\android.jar;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\platforms\android-21\data\res;D:\Android By Timothy\Package tools\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\tools\support\annotations.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 #C:\Users\SYS\AppData\Local\Temp\idea_junit7097204602616052537.tmp #w#C:\Users\SYS\AppData\Local\Temp\idea_working_dirs_junit3836436993075423504.tmp -socket54727
Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
Caused by: java.lang.ClassNotFoundException: junit.textui.ResultPrinter
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
Process finished with exit code 1
Now i got error:
11:51:25 UnsupportedMethodException
Failed to set up Android modules in project 'Telegram-master': Unsupported method: SourceProvider.getJniDirectories().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.
I tried, and here is steps:
Git clone the project to you disk
Import project on your Android Studio.
There was one Error of gradle. Change the gradle version to latest 1.0.0, such that
"classpath 'com.android.tools.build:gradle:1.0.0'
Get your own api_id form here.
Follow the doc.
EDIT
For 'signingConfig.storeFile' does not exist problem:
1: Look if you have the debug.keystore in (~/.android or search your whole android folder). If you haven't got it. Look this (There is no debug.keystore in .android folder) for create a debug.keystore.
2: When you have the file. You have to copy the file('debug.keystore') on (Telegram/TMessagesProj/config).

Error while install hadoop on mac

I was trying to install hadoob on mac. I got the following error. What could be the issue?
hadoop-0.20.203.0 administrator$ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
Exception in thread "main" java.io.IOException: Error opening job jar: hadoop-*-examples.jar
at org.apache.hadoop.util.RunJar.main(RunJar.java:90)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:72)
at org.apache.hadoop.util.RunJar.main(RunJar.java:88)
-Anish-
I had a similar issue with an example from the book Hadoop In Action. It turns out either the book had it wrong or the example jars now have a different naming scheme. In any case, your command should now begin with:
bin/hadoop jar hadoop-examples-*.jar

Categories