Chiranjhivi Ghimire
Chiranjhivi Ghimire

Reputation: 1739

How to distribute build .apk file of react-native application to different android device?

I have made practice application of react-native in android, I had build it and test on my real device which I had connected to my development pc. But when I copy the build .apk file from project folder and distribute among different devices with bluetooth or usb , I can install it on different devices but it shows problem of host address. Does it need development pc ip address always for running the application or can I bind some specific ip and run in all the devices? Please someone suggest me to deploy the general .apk file of my application. Thanks, in advance.

Upvotes: 0

Views: 807

Answers (2)

Jickson
Jickson

Reputation: 5193

When you build the apk in debug mode, then react-native communicates with your local server in your system. Only when you generate release build then react-native will run without any local server dependency.

So, If you need to distribute apk then you need to create a release apk. This link will help you to generate release apk.

Upvotes: 1

Hemant Tripathi
Hemant Tripathi

Reputation: 161

It sounds like that the problem is not with your application, its a network connection problem.

Are your using your System (Desktop) IP address for connection? or please check whether the IP address is a valid IP address.

Along with that also check in your manifest file whether you've added below permissions :

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Upvotes: 0

Related Questions