Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works in debug, but not in release for android #74

Open
jnystrom opened this issue Feb 8, 2019 · 2 comments
Open

Works in debug, but not in release for android #74

jnystrom opened this issue Feb 8, 2019 · 2 comments

Comments

@jnystrom
Copy link

jnystrom commented Feb 8, 2019

I can connect to the wifi SSID when I am running in debug in react-native, but when I create an APK, the same phone does not ever notice when it is connected to the SSID. I see it connect, buy my code loops and checks the current wifi ssid to see if it is actually connected, and that code never is successful. Any Ideas?

@bondparkerbond
Copy link
Contributor

I seem to be experiencing the same thing after upgrading to React-Native 0.59.1. @jnystrom What version of React Native are you on?

@bondparkerbond
Copy link
Contributor

bondparkerbond commented Mar 26, 2019

Update: For me the problem was that Android API 28 no longer allows unsecured requests and requires TLS/SSL/https. When building locally this is not enforced to allow connections to localhost, etc. If your build target is 27 or lower you can continue making http requests. However, if you need to make an unsecure(aka http) request to a local device over wifi, for example http://192.168.0.1/endpoint and you are targeting 28+, you can add a network_security_config.xml file to configure custom domains, etc. to continue being able to use it outside of debugging. Related information about certificate signing using a similar fix can be found in the Android documentation and in this RN issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants