Skip to content Skip to sidebar Skip to footer

Java.exe Finished With Non-zero Exit Value 1

Just for start, I am not rly trying to read cell(s) from .xlsx file in Android, I already tried almost everything what I Googled, but every time (on two different PCs, both Java 1.

Solution 1:

Unfortunately you cannot directly use Apache POI on Android due to third party library dependencies that are pulled in. Also the size of the library causes a very big application file, which is often not possible/desirable. You even sometimes exceed limits imposed by the Dalvik Android Bytecode compilation.

There are some resources available which discuss how to get POI running on Android:

Solution 2:

The reason is that at least one the libraries (xmlbeans.jar) is declaring classes that may conflict with the core libraries that Android uses.

xmlbeans declares classes in a javax.xml package - Android also has classes in this package and other similar ones.

From the error message:

If you are legitimately using some code that happens to be in a core package, then the easiest safe alternative you have is to repackage that code. That is, move the classes in question into your own package namespace.

Basically, the build tools think that you should be building a core library, but instead, you are attempting to build an application using a library which conflicts with the default Android core library. It suggests you move your code from the core package into a different package.

My advice - stop using external libraries that attempt to use core package names and use the XML functionality that Android provides.

Solution 3:

Problem: java.exe finished with non-zero exit value 1

Answer : For solving this problem I have tried most of the solutions and hit and try again and again.

At last found the solution to this problem.

These are possible solutions you should try for solving your problem and according to me, it will definitely solve your issue.

  1. Clean and Rebuild your Project.
  2. Please check all the libraries are updated and gradle build version also updated.
  3. try to increase your java heap size.
  4. Don't use lambda expressions or syntax in your code. in my case that is the problem because I was using lambda expressions and when I was using lambda expression then it needs a declaration in build.gradle (app)file like

compileOptions { targetCompatibility 1.8 sourceCompatibility 1.8 }

this.

it is the actual problem which I have faced please either remove this compileOptions declaration from build.gradle file or use the proper version which is compatible with your Gradle version.

Thanks

I hope this solution will help you and make your problem resolvable.

Solution 4:

I have an idea you can follow: some jars you import are internal API, like layoutlibs.jar, they are only involved in compiling, not packaged in apk.If you want to use them ,just create a folder named mylib in the root of the module ,then look the picture,follow them:

enter image description here

enter image description here

If my answer solve your problem ,please adopt it.

Post a Comment for "Java.exe Finished With Non-zero Exit Value 1"