Is there a way to go back to Java 7?

Issue #178 closed
Trần lê duy created an issue

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)

  1. Trần lê duy 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.

  2. Trần lê duy 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.

  3. Axel Kramer 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.

  4. Axel Kramer 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?

  5. Trần lê duy reporter

    Gradle Retrolambda Plugin

    I can not compile because of similar issues with dependent libraries.

  6. Log in to comment