9

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

Community
  • 1
  • 1
Edwin Chua
  • 658
  • 1
  • 8
  • 20
  • Try 'react-native start' from another console, and then start it. Also make sure nothing else is listening on port 8081. Also make sure your android paths are set correctly (think you should be able to find 'adb' from the console). Mine is in ~/Android/Sdk/platform-tools – Ian Dec 19 '16 at 07:55
  • what does `adb devices` yield? – Anna Melzer Dec 19 '16 at 08:22
  • 1
    thanks @Ian and @amelzer! 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. It works fine now :) The actions I took -- Install adb: `sudo apt install adb` , start packager: `react-native start` , then run app: `react-native run-android` . – Edwin Chua Dec 19 '16 at 08:52

2 Answers2

15

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

RainCast
  • 4,134
  • 7
  • 33
  • 47
4

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
Edwin Chua
  • 658
  • 1
  • 8
  • 20