How to run the React Native app on an Android phone

I am creating a React Native application.

It works well when I run the application in a terminal on a Mac using "run-native run-android".

But when I received the apk file and installed it on another Android device manually, it does not work.

It looks like this.

Crash on Huawei P8 lite

+5
source share
3 answers

It looks like the source code of your APK is looking for a package server.

Read this on how to create an APK for responsive-native: React-Native - Creating a Signed APK

If your devices are connected via cable:

  • If you are on a physical device connected to the same computer, run 'adb reverse tcp: 8081 tcp: 8081' to redirect requests from your device.

Otherwise, you can do it via Wifi, following the last point of the error:

  • If your device is on the same Wi-Fi network, set "Host and port debug server" in "Dev Settings" to your device IP address and port of the local development server, for example, 10.0.1.1:8081
+6
source

If you updated your version of responsive-native from the moment you created your Android project files, you might want to regenerate them. I think you can use react-native upgrade .

+1
source

I generated a signed apk to respond to my own application, now I want to provide a distribution. Can others install it on their device.it gives the error java.lang.RuntimeException: ReferenceError: Cannot find the variable: __fbBatchedBridge (: 1) Because the server running the reaction is not running. How can a user install my application.

-1
source

Source: https://habr.com/ru/post/1247077/


All Articles