Getting Ready
Install latest Android Studio version (I’m using Flamingo 2022.2.1).
Install XCode, command line tools tools and Simulator.
Make sure your Kotlin Plugin has 1.8.x version.
Make sure you have Ruby gem installed.
gem list
Make sure you have Java JDK installed.
java --version
To use the Android KMM Wizard Template, first you need to install a KMM plugin and restart AS.
Clone the repository. Try opening the starter project in Android Studio (you need to choose the whole project, not only androidApp).
Sync the dependencies:
Build and run the app.
If the emulator starts, then everything is fine 👌
If you run into a problem, it may be one of these:
If you have a Apple M1 Chip and the next command in terminal returns empty:
echo $LANG
Then in terminal:
open -e ~/.zshrc
And add this line to the opened file:
export LANG=en_US.UTF-8
After saving your .zshrc file, you must run next command:
source ~/.zshrc
If you’re running into Java JDK problem, do the following:
/usr/libexec/java_home -V
Your output should be something like:
18 (arm64) "Oracle Corporation" - "OpenJDK 18" …/Library/Java/JavaVirtualMachines/openjdk-18/Contents/Home 1.8.0_292 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
brew install openjdk@17
sudo ln -sfn /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
/usr/libexec/java_home -V
Your output should be something like:
18 (arm64) "Oracle Corporation" - "OpenJDK 18" /Users/lenastepanova/Library/Java/JavaVirtualMachines/openjdk-18/Contents/Home 17.0.7 (arm64) "Homebrew" - "OpenJDK 17.0.7" /opt/homebrew/Cellar/openjdk@17/17.0.7/libexec/openjdk.jdk/Contents/Home 11.0.17 (arm64) "Amazon.com Inc." - "Amazon Corretto 11" /Users/lenastepanova/Library/Java/JavaVirtualMachines/corretto-11.0.17/Contents/Home
open ~/.zshrc
In zshrc add and save: export JAVA_HOME=$(/usr/libexec/java_home -v 17.0.7)
-
export JAVA_HOME='/usr/libexec/java_home -v 17.0.7\'
-
Also make sure you're using the correct Gradle JDK version in Android Studio
If nothing still works, you can try checking out ADC-0-starter branch and setting up your java environment to Java 11.