Unable to build react-native app on Android device :failed to find target with hash string 'android-23' -
here full error: failed find target hash string 'android-23' in: /users/username/library/android/sdk
this build.gradle
file in android/app
:
android { compilesdkversion 23 buildtoolsversion "23.0.1" defaultconfig { applicationid "com.mobile" minsdkversion 16 targetsdkversion 22 versioncode 1 versionname "1.0" ndk { abifilters "armeabi-v7a", "x86" } }
i ran android sdk manager, , have android sdk build-tools
rev 23.0.1 installed, along files android 6.0 (api 23).
i searched online problem , have tried many solutions; restarting terminal, deleting gradle file in root directory, making sure android_home points correct directory (as following reactnative docs, have copied in both ~./bashrc
, ~./bash_profile
following line: # if installed sdk via homebrew, otherwise ~/library/android/sdk export android_home=/usr/local/opt/android-sdk
.
nothing has worked me far , keep getting same error. should add working fine until installed android studio, after point started getting error. have since uninstalled android studio naively thinking solve problem.
please me so, you're hope.
find android sdk installed location.
(e.g /users/username/library/android/sdk or /usr/local/opt/android-sdk or /applications/adt/sdk)
open
~/.bash_profile
or~/.bashrc
.
sudo gedit ~/.bash_profile
- add or edit below
export android_home=***your_android_sdk_path*** export path=$path:$android_home/tools:$android_home/platform-tools
- restart terminal run again.
Comments
Post a Comment