问题
I developed an app with React native and install debug apk in my device and all of the things are ok.
but when install release version in my device, it can't get data from API.
what's wrong?
回答1:
In my case, I call api with non secure (http instead of https). So api work well for debug environment, but not work for release. You can add this line
android:usesCleartextTraffic="true"
to AndroidManifest.xml
like that
<uses-permission android:name="android.permission.INTERNET" />
<application
...
android:usesCleartextTraffic="true"
...
来源:https://stackoverflow.com/questions/54418709/react-native-android-release-apk-cant-receive-data-from-internet