Is there a way to go back to Java 7?
Is there a way to go back to Java 7
?
Currently, Android applications are programmed by using Android Studio and usually use Java 7.
If you import the library symja-java8, you will get a compilation error like this
Error: Error converting bytecode to dex:
Cause: Dex can not parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
I added those two lines to build.gradle but did not work.
I have tried to fix for a long time but there is no way to compile this library.
Who has compiled symja-java8 library on Android Studio?
I also enable jack
. But this only support Android N a above.
Error:Default method org.hipparchus.analysis.solvers.BracketedRealFieldUnivariateSolver$Interval solveInterval(int null, org.hipparchus.analysis.RealFieldUnivariateFunction null, org.hipparchus.RealFieldElement null, org.hipparchus.RealFieldElement null) not supported in Android API level less than 24
Error:Default method org.hipparchus.analysis.solvers.BracketedUnivariateSolver$Interval solveInterval(int null, org.hipparchus.analysis.UnivariateFunction null, double null, double null) not supported in Android API level less than 24
Error:Default method boolean isTransposable() not supported in Android API level less than 24
Error:Default method org.hipparchus.linear.RealVector operateTranspose(org.hipparchus.linear.RealVector null) not supported in Android API level less than 24
Error:Execution failed for task ':app:transformClassesWithPreJackPackagedLibrariesForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.core.JackToolchain$ToolchainException: Jack compilation exception
If possible, please move on to Java 7, the Java version 7 works very stable.
Comments (10)
-
repo owner -
reporter Why do you decide to only support devices with API > 24? There are no more than 8.1% of Android devices running this version.
-
reporter I want to upgrade to the latest version of the library for my application because it seems that recent updates have improved precision of decimal precision.
-
repo owner It's Googles decision to only support API>24. Before that new decision I assumed that the java8 toolchain would be available for older APIs.
-
reporter Will you decide to migrate to Java 7?
-
repo owner The problem is that used libraries like JAS also use Java8. So at the moment it's not so easy to backport the complete system.
Maybe the retrolambda-maven-plugin can help if all Java8 dependent sources from dependent libraries are included in the project?
-
reporter Gradle Retrolambda Plugin
I can not compile because of similar issues with dependent libraries.
-
reporter Backport to Java 7 with Gradle Retrolambda https://github.com/tranleduy2000/symja_java7/releases/tag/v1.1
-
repo owner Please use the Github issue tracker to open a new issue if this issue shouldn't be closed Github issues
-
repo owner - changed status to closed
- Log in to comment
The jack toolchain is deprecated: See: https://developer.android.com/studio/write/java8-support.html
Also did you see Issue #147