9

I made an app using react native. The app connects to the api that I made. I followed these steps : https://facebook.github.io/react-native/docs/signed-apk-android, and now the app doesn't work if i do react-native run-android --variant=release.The app installs, but I can't login in the app. Is there any way to see if I get any errors or something?

I tried searching for a way to show the debbuging console even if the variant is release, but i can't find any

I want the app the work as the one that is not in release variant.

Darius Biro
  • 169
  • 1
  • 3
  • 11

3 Answers3

25

maybe you need to add android:usesCleartextTraffic="true" inside the application tag in the AndroidManifest.xml .

Something like this:

<application
  ...
  android:usesCleartextTraffic="true"
  ...
>
   ...
</application>
SmoggeR_js
  • 2,715
  • 4
  • 18
  • 47
  • And after i modify this, do I need to do gradlew assembleRelease, or just rerun with run-android --variant=release? I'm not sure how it works... it's my first app – Darius Biro Jul 31 '19 at 12:46
  • just run-android – SmoggeR_js Jul 31 '19 at 12:48
  • 1
    Oh my God.... thank you so much... i've been tring this all day... thank you a lot... Now i have one more question if you could help me. Now that i added this, do i have to do all the steps here or does it save somehow automatically? – Darius Biro Jul 31 '19 at 13:01
  • I'm glad to hear that! About the second question, If you did all that steps you just have to create a new APK by assembleRelease and upload a new version to Google Play. Remember to change the compileVersion and the NameVersion and would be all done – SmoggeR_js Jul 31 '19 at 13:05
  • Modify it in //android/app/src/main/AndroidManifest.xml – George Livingston Aug 02 '20 at 17:01
0

Please try to be precise or else its difficult to understand the problem.

In order to catch the issues in release mode we have couple of libraries which will help us debug even when the real user is using the app. Check the below two libs they might help you find the issue.

  1. Busgnag
  2. Crashalytics, a module in react-native-firebase
Gokul Kulkarni
  • 1,834
  • 3
  • 26
  • 40
  • I made the app. It works when I run it with react-native run-android. I get no errors or anything. When I try to run it with react-native run-android --variant=release, it installs the app, it launches the app, but when I press the login button just.... nothing hapens... I don't get any errors or anything... it just doesn't redirect me from the Sign in screen to the App screen – Darius Biro Jul 31 '19 at 12:40
0

I think the issue is because it's an http request.

This might fix your issue: https://stackoverflow.com/a/55834683/6667328

Sanyam Jain
  • 1,124
  • 6
  • 9