My goal is to run an old project. It uses React Native 0.63.3. This is the repository
What I've did:
- Setup the environment by following the docs for 0.63
- Installed Android Studio a month ago.
- did
$ brew install --cask adoptopenjdk/openjdk/adoptopenjdk8 - did not do
$ brew install nodebecause it is already installed. - did
$ brew install watchman - Installed
Android SDK Platform 29on Android Studio. - Installed
Google APIs ARM 64 v8a System Imageunder theAndroid 10 (Q)entry because I use Mac Mini M1 instead ofGoogle APIs Intel x86 Atom System Imagenot documented on the docs for 0.63 - Installed
Android SDK Build-Tools 29.0.2on Android Studio. - Added environment to
~/.zprofileand did$ source ~/.zprofile
JAVA_HOME is not documented on the docs for 0.63, this is to fixeval "$(/opt/homebrew/bin/brew shellenv)" export ANDROID_HOME=/Volumes/T7Touch/Library/Android/sdk export PATH=$PATH:$ANDROID_HOME/emulator export PATH=$PATH:$ANDROID_HOME/tools export PATH=$PATH:$ANDROID_HOME/tools/bin export PATH=$PATH:$ANDROID_HOME/platform-tools export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Homecd android && ./gradlew cleanissue
Then, I tried to run it by $ npm run android
However, it throws an error
...
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4m 39s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01