{Solved} Errors when building for android

Hi
When building for android i had this error at the end when packing apk file
Link: libApplicationMain-64.so
Downloading http://services.gradle.org/distributions/gradle-2.10-bin.zip

Unzipping C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0\gradle-2.10-bin.zip to C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0
Exception in thread “main” java.util.zip.ZipException: zip file is empty
** at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1470)**
** at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1284)**
** at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1378)**
** at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1209)**
** at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1172)**
** at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:719)**
** at java.base/java.util.zip.ZipFile.(ZipFile.java:239)**
** at java.base/java.util.zip.ZipFile.(ZipFile.java:169)**
** at java.base/java.util.zip.ZipFile.(ZipFile.java:183)**
** at org.gradle.wrapper.Install.unzip(Install.java:214)**
** at org.gradle.wrapper.Install.access$600(Install.java:27)**
** at org.gradle.wrapper.Install$1.call(Install.java:74)**
** at org.gradle.wrapper.Install$1.call(Install.java:48)**
** at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)**
** at org.gradle.wrapper.Install.createDist(Install.java:48)**
** at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)**
** at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)**


But after downloading grade 2.1.0 and put it into folder.
C:\Users<username>.gradle\wrapper\dists\gradle-2.10-bin\gradle-2.10
I have new issue:
"Link: libApplicationMain-64.so
aarch64-linux-android-strip: unable to rename ‘libApplicationMain-64.so’; reason: Permission denied"

i’m using all latest versions of Haxe, OpenFL, Hxcpp, lime,…
Cl: lime build E:\xxx\xxxx\xxxx\project.xml android -release -Dfdb
project.xml

>     <architecture name="arm64" />
    <architecture exclude="armv6"/>

please help , thank you

After cleaning up project. I still had this issue!

Link: libApplicationMain-64.so
Downloading http://services.gradle.org/distributions/gradle-2.10-bin.zip

Unzipping C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0\gradle-2.10-bin.zip to C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0
Exception in thread “main” java.util.zip.ZipException: zip file is empty
** at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1470)**
** at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1284)**
** at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1378)**
** at java.base/java.util.zip.ZipFile$Source.(ZipFile.java:1209)**
** at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1172)**
** at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:719)**
** at java.base/java.util.zip.ZipFile.(ZipFile.java:239)**
** at java.base/java.util.zip.ZipFile.(ZipFile.java:169)**
** at java.base/java.util.zip.ZipFile.(ZipFile.java:183)**
** at org.gradle.wrapper.Install.unzip(Install.java:214)**
** at org.gradle.wrapper.Install.access$600(Install.java:27)**
** at org.gradle.wrapper.Install$1.call(Install.java:74)**
** at org.gradle.wrapper.Install$1.call(Install.java:48)**
** at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)**
** at org.gradle.wrapper.Install.createDist(Install.java:48)**
** at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)**
** at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)**

How can I set correct path for gradle?
C:\Users \ username \ .gradle\wrapper\dists\gradle-2.10-bin\gradle-2.10
or C:\Users \ username \ .gradle\wrapper\dists\gradle-2.10-bin.

or other solutions?
Thks!

You can:

  1. Try to download http://services.gradle.org/distributions/gradle-2.10-bin.zip via the browser
  2. Unzip the file in directory : C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0**

Hi . it did not work even we set GRADLE_HOME path. I will install Android Studio for the next try.
Any suggestions? Thks!

Is it give the same error ?
Because C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0\gradle-2.10-bin.zip is trying to unzip the gradle-2.10-bin.zip. Do you have this file there ( with size > 0) ? Also if you download file via browser and unzipped be sure it is in correct folder.

Yes, I had all extracted files there C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0 and having same issues.!

Updated: installing Android studio does not help much. The error is still there!

It is so weird. i get it work by download http://services.gradle.org/distributions/gradle-2.10-bin.zip
and put it in C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0**.
Remember not to unzip it.

But i had new error


FAILURE: Build failed with an exception.

*** What went wrong:**
Could not determine java version from ‘13.0.1’.

Which JDK version should we use for building apk files?
I already set JAVA_HOME: C:\Program Files\Java\jdk-13.0.1

Thanks?

What version of gradle do you use ? ( check with gradle --version )
At exampl java 11 is supported from gradle 5.0 ( https://docs.gradle.org/5.0/release-notes.html#java-11-runtime-support )
Java 13 support is planned for Gradle 6.0 ( check here https://github.com/gradle/gradle/issues/10785 )
So you need to download the java version or upgrade to release candidate gradle 6.0 for java 13.

{Solved}

  1. download gradle 2.10 http://services.gradle.org/distributions/gradle-2.10-bin.zip and put it into folder
    *C:\Users\xxxxx\ .gradle\wrapper\dists\gradle-2.10-bin\2v0chm5oshw52qn5d7jjz7lo0*
    Do not unzip it,.

  2. Install JDK 1.8, and Android SDK API 28

1 Like