react-native: cannot run app on Android 4.4 device

I am trying with React Native Android for the awesome project. It was successful running under emulator while fail with the real device with android 4.4. Here below is the output:

...
Installed on 1 device.

BUILD SUCCESSFUL

Total time: 10.449 secs

This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html
Starting the app (adb shell am start -n com.awesomeproject/.MainActivity)...
Starting: Intent { cmp=com.awesomeproject/.MainActivity }
Error type 3
Error: Activity class {com.awesomeproject/com.awesomeproject.MainActivity} does not exist.

_Can anyone give a hint?_

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

The documentation provided is for Android 5.0 and above as adb reverse works only from Android 5.0 and above. I got a “Unable to download JS bundle” error on the device when I tried to run it on a KitKat device I solved it by building the bundle file using the command

curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"

followed by react-native run-android (Create the necessary folders if they don’t exist) The only problem being that I have build and run every time I make a change

  1. Do you have USB debugging enabled on your device: http://facebook.github.io/react-native/docs/running-on-device-android.html#usb-debugging
  2. Try building app manually using gradle: cd android and ./gradlew :app:installDebug
  3. If the above fails try running adb command to install apk (should provide more output) from android dir in your project: adb install app/build/outputs/apk/app-debug.apk

@rogerwq By any chance do you have more than one device connected (e.g. real device + emulator). What is the output of adb devices when you get the error you’ve posted?

Also for running on device <5.0 please refer to this section: http://facebook.github.io/react-native/docs/running-on-device-android.html#configure-device-to-connect-to-the-dev-server-via-wi-fi

@kmagiera thanks for the suggestions. Both option 1 and 2 installed the app on my phone but I still see the red screen with “Unable to download JS bundle”.