Reputation: 6232
I'm trying to run react native on mac, I run the android emulator in the background and run react-native run-android
and I get:
=> react-native run-android
Scanning 564 folders for symlinks in /Users/sao/Conv/Conv2/node_modules (19ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
The react awesome project (react-native init
) works fine on this machine and this project run fine on windows.
It says check error above for details but there's no error above...
Any ideas on how to make it work?
Upvotes: 1
Views: 5781
Reputation: 482
try running adb devices
in terminal, if its blank run adb kill-server
then follow it up with adb start-server
Upvotes: 5
Reputation: 3131
As you said emulator is already running so the other problem can be (according to the error message) that your SDK path is not set in your android project. I got the similar issue and did the following:
E.g. in my system SDK path is sdk.dir: /Users/USER_NAME/Library/Android/sdk.
Upvotes: 2
Reputation: 987
Had the same problem, ended up recreating the project on a mac and added the files from the old project;
My project uses git, so I can tell you that the only files that did change while I recreated the project are:
I guess you could create a new project and copy-paste those files, but I'm not sure that it would work, as I did not try it.
Upvotes: 2
Reputation: 22872
As stated in the log, you HAVE TO be running simulator or connect real device to Mac
To setup simulator, use Android Studio. Connecting device is much easier and faster, assuming you have one available.
Upvotes: 0