I’m getting the same kind of error as this guy in the forums when I try to package for android.
UE4.15.1 from launcher
macOS Sierra 10.12.3
Java 6 & 8 installed
CodeWorksforAndroid-1R5 from Engine/4.15/Extras/Android/Mac from launcher install
JAVA_HOME=“/usr”
Output Log stuff
Any ideas?
Hi! In your log it’s trying to compile with an older version of Java. Can you try to override it and see if that works? You can override it by going to Project Settings > Platforms > Android SDK > Location of Java and point that to the folder where you have the java 8 jdk installed. If that works, I would try uninstalling java 6 and making sure your JAVA_HOME points to the right place.
There is no such setting for me. I am on 4.15.1 on Mac. For me there are no settings that specifically contain the word “java”, and JAVA_HOME
is set to /usr
and /usr/bin/javac -version
gives me javac 1.8.0_112
I upgraded from macOS 10.12.3 to 10.12.4, from Xcode 8.2 to Xcode 8.3, rebooted, deleted the codeworks stuff (the entire ~/NVPACK
directory) and reinstalled it.
And now the build succeeds. I did not change any Project Settings. I did not uninstall or reinstall any Java (still have Java 6 and 8 installed).
Note that the build does not like my JAVA_HOME
variable. It complains (though still succeeds):
Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java...
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
Good catch. Because in previous versions of macOS the java was packaged with the OS, we did not expose this setting. I will bug this for 4.16
o_O Java hasn’t been included with OS X/macOS since version 10.9. 10.10 came out 3.5 years ago! Sounds like it’s time to expose that setting!
Whoah, props to you! It takes ~6 months for my fixes to get accepted for a release (4 patches accepted, quickest was 1 month, slowest was 14 months). You must be a dev on Epic Staff?
Analyst for Android. Thanks for the report!
I take it back. After another reboot (unrelated), I’m back to the original error. Reinstalling codeworks and rebooting again doesn’t fix it this time. 
Found it. It wasn’t the reinstall of codeworks, it’s the setting of JAVA_HOME="/usr"
in ~/.profile
and rebooting. I had taken that out because of the errors I mentioned above, but the ironic thing is that it WORKS when it is set (with lots and lots of complaining about JAVA_HOME
), but without it just fails with the original problem I started this post for.
Craziness. So there’s a bug. If JAVA_HOME is set correctly, you’ll get tons of crap about it.
On the plus side, with JAVA_HOME set correctly, you no longer have to install Java 6 alongside 8. You can just have 8 installed. Finally.