Http requests fails only while releasing Android APK

后端 未结 3 2225
春和景丽
春和景丽 2021-02-19 07:43

I\'m struggling in making my app work on Android APK release, the only scenario it fails is at generating and signing the apk. All http requests doesn\'t work. (The server is ru

相关标签:
3条回答
  • 2021-02-19 08:26

    I had this exact same issue some time ago. In my case the problem was an invalid certificate. The certificate looked fine to me in the browser (chrome even showed the green lock), on iOS and while testing on Android. But I had android-users complain it wasn't working for them.

    After hours of researching it turned out that requests to websites with invalid certificates just get silently dropped, which means there is no feedback whatsoever. No errors, nothing. (If I remember correctly, the js code just stopped executing without returning or executing any callbacks.) This happens ONLY when building in release mode.

    A workaround is described here:

    http://ivancevich.me/articles/ignoring-invalid-ssl-certificates-on-cordova-android-ios/

    The best way to handle it would be to pin the certificate in your app.

    0 讨论(0)
  • 2021-02-19 08:27

    My issue was incomplete SSL chain, solve it by reconfiguring nginx to have the entire chain of SSL certificates as described here: http://nginx.org/en/docs/http/configuring_https_servers.html#chains

    0 讨论(0)
  • 2021-02-19 08:27

    My problem was with SSL as well. If you get an "A+" rating from this website, it should work. My original grade was "B". https://www.ssllabs.com/ssltest

    You can use this site to correct it. https://whatsmychaincert.com/

    0 讨论(0)
提交回复
热议问题