-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Fetch not working in release APK #24361
Comments
Make sure your |
Thanks!! I didn't know that |
Are there any documents by RN related to this change log? Please do share if it exists. And here(#24408) is a workaround for the issue. |
If anyone is facing the same issue, because of the "http" just add |
adding android:usesCleartextTraffic="true" solved my problem , I was facing issues when making Http requests . |
I have |
@eric-khoury 解决了吗 |
We are facing this issue even though all our URLs use HTTPS. Anybody else experiencing that problem? Edit: In the end it was another package being broken that caused this: react-native-config |
hmm using react-native 60.5 and I have this issue in release build .... |
@schumannd can you tell me what did you do with the react-native-config package to solve the problem? Thank you very much |
@nghiep9523 it was an issue described in their repos README under troubleshooting as "Problems with Proguard"
|
Is there any fix for this? I am having the same issues with an HTTPS url, I tried @schumannd's recommendation but that didn't fixed the problem. Any help would be greatly appreciated, at this point I'm considering switching to axios |
@rodrigomf24 we ended up running into several other issues with this package as well. I would open an issue over at their repo |
I am facing same issue in rn 61.5. Both http and HTTPS not working in release mode. Already tried with fetch and axios, still no difference. |
Adding |
My shopify public api (https://{apikey}:{password}:@{shop-domain}//admin/customers) working perfectly on ios and postman but not on android. It gives 401 error : "Invalid API key or access token (unrecognized login or wrong password)" on android phone. Any help would be greatly appreciated! |
same error here, i put |
🐛 Bug Report
I use a login in my app, when I test on development environment on my phone I have any trouble I can log in. But when I build the release APK it seems like the app can not connect with the fetch (the code enter in the catch of the fetch)
My AndroidMainfest.xml has the INTERNET pemission
Code Example
fetch(config.urlServer + "/index.php/AppServer/signin", { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ email: this.state.email, password: this.state.password }) }).then(res => res.json()) .then((responseJson) => { console.log(responseJson); if(responseJson.result){ this.props.setSession(responseJson.user); this.props.navigation.navigate('Main'); }else{ Toast.show({ text: responseJson.error, buttonText: 'Cerrar', type: "danger" }); } }).catch((error) => { console.error(error); Toast.show({ text: 'Hubo un Error', buttonText: 'Cerrar', type: "danger" }); })
Environment
React Native Environment Info:
System:
OS: macOS 10.14
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 72.54 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.9.0 - /usr/local/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 19, 23, 24, 26, 27, 28
Build Tools: 23.0.1, 26.0.3, 27.0.3, 28.0.2, 28.0.3
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.3 => 0.59.3
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-rename: 2.4.1
The text was updated successfully, but these errors were encountered: