Skip to content Skip to sidebar Skip to footer

How Would I Update My Android_sdk_root / Java_home / Path Environment Variables On A Mac To Build Android

I'm building an Ionic Cordova cross platform app. When i run ionic cordova build android I get the following error. Here is my java version: java version '15.0.1' 2020-10-20 Java

Solution 1:

Android fully supports java 7 and a subset of java 8 and 9 features. So, yes, the JDK 15 you downloaded is not compatible with the Android development platform.

AdoptOpenJDK 1.8 is the preferred JDK for Android development (don't quote me on this, there may be disagreements)

Then, from the build log you can see ANDROID_SDK_ROOT=undefined (recommended setting). That's fine, ANDROID_SDK_ROOT can be undefined.

After you've downloaded the correct JDK, the only two environment you need to set are:

exportJAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/HomeexportANDROID_HOME=/Users/$USER/Library/Android/sdk

Post a Comment for "How Would I Update My Android_sdk_root / Java_home / Path Environment Variables On A Mac To Build Android"