I just upgraded my toolchain from Ubuntu MATE 16.04 + Eclipse Luna + ADT to Ubuntu MATE 18.04 + Eclipse Oxygen + Andmore.
I converted one of my existing ADT-based Android projects to Andmore and tried to build it. However, I get the following error message:
Errors occurred during the build.
Errors running builder 'Android Package Builder' on project 'qz'.
sun/misc/BASE64Encoder
I have done some research and got a few pointers but no final solution.
Here is a question about a similar error message; the only answer and one of the comments to it suggests that it has to do with the class being deprecated in Java 9, the deciding factor being the JVM which Eclipse runs on (as opposed to the target JVM for the app).
This post on the Eclipse community forum also mentions JRE 8 and shows the configuration setting for it.
When I go to Window > Preferences > Installed JREs, I see one single entry for /usr/lib/jvm/java-8-openjdk-amd64
, which should be correct by the answers quoted above.
For completeness, Ubuntu 18.04 seems to come with two Java versions, as java -version
on the command line gives me:
openjdk version "10.0.1" 2018-04-17
OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode)
On top of that, I just noticed that in my workspace tree, -metadata/.plugins/org.eclipse.andmore.android.logger/environment.log
has:
2018-05-03 20:06:03,654 - os.name - Linux
2018-05-03 20:06:03,655 - os.arch - amd64
2018-05-03 20:06:03,655 - os.version - 4.15.0-20-generic
2018-05-03 20:06:03,655 - java.version - 10.0.1
2018-05-03 20:06:03,655 - java.vendor - Oracle Corporation
2018-05-03 20:06:03,655 - java.vendor.url - http://java.oracle.com/
2018-05-03 20:06:03,655 - java.home - /usr/lib/jvm/java-11-openjdk-amd64
2018-05-03 20:06:03,655 - java.vm.specification.name - Java Virtual Machine Specification
2018-05-03 20:06:03,655 - java.vm.specification.vendor - Oracle Corporation
2018-05-03 20:06:03,655 - java.vm.specification.version - 10
So apparently Andmore is running on OpenJDK 10 (the default JRE on my system), rather than the one selected for Eclipse.
How can I fix this?
Looking at eclipse.ini
(in my Eclipse path), I found an explicit reference to JRE 11:
-vm
/usr/lib/jvm/java-11-openjdk-amd64/bin
After I changed that to
-vm
/usr/lib/jvm/java-8-openjdk-amd64/bin
I finally get an APK, and after cleaning the project once, I was able to install it on a device.