Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App not starting - React Native (Android)

I was trying out React Native's Getting Started guide. After completing the installation, I tried to run the application.

It seems that while the application had successfully been deployed to the virtual device, the debugger did not attach / the app did not automatically start.

I am running on Ubuntu 16.04 LTS. Any ideas?

My terminal output is below.

Installing APK 'app-debug.apk' on 'emulator-5554 - 7.1' Installed on 1 device.

BUILD SUCCESSFUL

Total time: 7.922 secs

This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html /bin/sh: 1: adb: not found Starting the app (adb shell am start -n com.awesomeproject/.MainActivity...

Nothing happens, and I get the red screen of death when I try to run the application from the virtual device. I also explored this solution. Thanks in advance

like image 215
Edwin Chua Avatar asked Dec 19 '16 06:12

Edwin Chua


2 Answers

I met the same issue, for me, I solved it by running the following config:

export ANDROID_HOME=${HOME}/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools

reference: https://facebook.github.io/react-native/docs/getting-started.html

like image 163
RainCast Avatar answered Oct 30 '22 05:10

RainCast


Thought I would come back to close my question. My solution:

It seems that ADB had not been installed (didn't know this had to be done manually). Subsequently, I had to manually start the packager.

The actions I took:

  • Install adb: sudo apt install adb
  • start packager: react-native start
  • Run app: react-native run-android
like image 24
Edwin Chua Avatar answered Oct 30 '22 04:10

Edwin Chua