Deploy an app from Android Studio
I've spent two hours fighting with Android Studio and React Native in order to deploy an app. It was working from console using
react-native run-android, but not from Android Studio. These are the things that have finally worked for me:
Obviously, follow step by step the instructions from Getting Started > Building Projects with Native Code > macOS + Android.
In Android Studio, under File > Project Structure > SDK Location check the Use embedded JDK option.
In Android Studio, under Android Studio > Preferences > Build, Execution, Deployment > Instant Run totally disable Instant Run. Strangely enough, this seems to be a problem only in some cases -not always-, but worth to keep it in mind.
In order to create an
.apkfile that does not rely on any React Packager running so that it can be distributed to betatesters, follow the instructions from Generating Signed APK.