Build APK Java 1.8.0_221 (Latest IDEA Build)

Answered

Hi!

When I'm trying to build APK I get following error. I know sun/misc/BASE64Encoder was removed in Java 9, but what can cause this error with Java 8?

Regards
Meelis

 

0
6 comments

Please try re-install from https://www.jetbrains.com/idea/download/ into a new empty directory.

If problem remains please file an issue at https://youtrack.jetbrains.com/issues/IDEA with idea.log file attached after IDE restart and reproducing.

As a workaround try to run IDE under 8 Java Runtime (see Bundled JBR 8 distribution here: https://www.jetbrains.com/idea/download/other.html).

0
Avatar
Permanently deleted user

I got the same error and I have a clean install of IntelliJ 2020.1:

I guess it has to do that the IDE uses JDK 11. How can switch to JDK 1.8?

0

See https://intellij-support.jetbrains.com/hc/articles/206544879 for the details how you can switch to JDK 8.

It's recommended to switch to Gradle builds for Android, apparently you are still using the legacy project and build APKs via the IDE, not via Gradle.

1
Avatar
Permanently deleted user

I managed to change the JDK used by the IDE, via Choose Runtime plugin.

Does Gradle have an APK wizard? I am using the old APK wizard. How about back porting so that the old APK wizard works under JDK 11? My subjective feeling is that the old APK wizard is faster, Gradle builds are extremly slow.

0

You don't need a wizard, just create a target in your gradle build file, see https://stackoverflow.com/a/21020469/104891 .

I've reported https://youtrack.jetbrains.com/issue/IDEA-241862 for the APK Wizard issue.

1
Avatar
Permanently deleted user

I will probably need Gradle when generating APK from JDK 1.8 code? Because of de-sugaring phase. Currently I am targeting still JDK 1.5 code without lambdas. So in the future, in case I will need lambdas, I might switch to Gradle indeed. Not sure when gradle would be mandatory for me. I would love to see a blinding fast Gradle. This is a little slow:

Old APK wizard, only the compilation step, few seconds???

Gradle APK wizard, compilation was somewhere in the 1 minute time!!! The signing did not recompile.

0

Please sign in to leave a comment.