React Native : target with hash string 'android-X' not found

前端 未结 8 1550
[愿得一人]
[愿得一人] 2021-02-01 14:56

I am trying to develop my first react-native Android app. When I run

sudo react-native run-android

I get the following error

相关标签:
8条回答
  • 2021-02-01 15:05

    please try to install android 6.0 (Marshmallow) api level 23

    i just did and works for me

    0 讨论(0)
  • 2021-02-01 15:07

    You need to point ANDROID_HOME to the parent directory of platforms and platform-tools so /usr/local/Cellar/android-sdk

    0 讨论(0)
  • 2021-02-01 15:22

    0 讨论(0)
  • 2021-02-01 15:22

    What helped me - I've just removed all installed SDK Platforms and SDK tools using Android SDK Tool

    And Run build again and Android Studio found what it should install and where. If you will follow this instruction - make sure you are running Android Studio with enough permissions to install everything.

    Have fun with this issue! Hope it will help you

    0 讨论(0)
  • 2021-02-01 15:24

    Your $ANDROID_HOME should point to /usr/local/android-sdk and it would be the parent directory of platforms and platform-tools

    Gradle will try to locate tools dir in the following location: $ANDROID_HOME/platform/android-23 so verify that you have your tools installed there if the android-23 folder is not present inside $ANDROID_HOME/platform/ , please install Android 6.0 (API23)

    0 讨论(0)
  • 2021-02-01 15:24

    None of the above solutions worked for me, working on a react native app generated with Ignite. Finally, I opened the project up in Android Studio, instead of doing everything via the command line, and a bunch of errors popped up. Fixing the errors one by one within Android Studio solved this problem for me.

    You do need the correct path set for ANDROID_HOME for this to work. I installed android sdk with brew, so my path was /usr/local/opt/android-sdk.

    0 讨论(0)
提交回复
热议问题