1.Go to Editor->Manage export template->Download and install->Close.
2.Download command-tools cli for linux at https://developer.android.com/studio/#command-tools.
Scroll down until you see the Command line tools section.
Then add `export ANDROID_HOME="/path/to/android-sdk"` to your `.bashrc` or `.zshrc` (for other shell, try to edit it accordingly), and unzip the file to: `/path/to/android-sdk/`
Example: `$HOME/Android/android-sdk`
3.Download Openjdk latest version.
Set JAVA_HOME to your `.bashrc`: `export JAVA_HOME=$(which java|rev|cut -d'/' -f3-|rev)`
Install required tools&packages from sdkmanager: `$ANDROID_HOME/cmdline-tools/bin/sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "build-tools;34.0.0" "platforms;android-34" "cmdline-tools;latest"` "cmake;3.10.2.4988404" "ndk;23.2.8568313"
You can also choose which version you want to download, just playing around with the sdkmanager.
4.Go to Editor->Settings->Search for "SDK"->Set the Java Sdk path with `$JAVA_HOME` & Android Sdk path with `$ANDROID_HOME`.
Just enter this on terminal to get them: `echo $JAVA_HOME&&echo $ANDROID_HOME`
Then copy the corresponding path into the Editor Settings. Then Close the Editor Settings.
If all Ok, then there shouldn't be any red errors appears afterwards.
Go to Project->Export->Add platform: Android->set Product name->Export Project->Select path to save it&Uncheck export with debug->Save.
Then install the apk file you have created, and play.
Note that some phone can't install the apk, i dont know why.
Try to build the same project with 2 different machine and try to install both to test.
Komentar
Posting Komentar