简体   繁体   中英

react-native run-android stuck

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
* daemon not running; starting now at tcp:5037
* daemon started successfully
info Installing the app...
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
File /home/muhamed-kveshkshaano/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 28.0.3 in /home/muhamed-kveshkshaano/Android/Sdk/licenses
License for package Android SDK Build-Tools 28.0.3 accepted.
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" ready.
Installing Android SDK Build-Tools 28.0.3 in /home/muhamed-kveshkshaano/Android/Sdk/build-tools/28.0.3
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" complete.
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" finished.
Checking the license for package Android SDK Platform 29 in /home/muhamed-kveshkshaano/Android/Sdk/licenses
License for package Android SDK Platform 29 accepted.
Preparing "Install Android SDK Platform 29 (revision: 5)".
<=============> 100% CONFIGURING [44m 43s]
> IDLE

I try couple of time but the problems is the same it get stuck at same over and over again, can't find any solution, do any one knows how to fix it?

The solution is to create a file named local.properties in the android folder of the react-native project and write this line in it:

sdk.dir=<the path to your android sdk>

example:

sdk.dir=/Users/anmol/Library/Android/sdk

I am using Mac, so the path will vary for windows & linux.

you can get the sdk android path via android studio: Android Studio - How to Change Android SDK Path

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM