[FIXED] ionic cordova app loose network access after update
I just upgrade an existing application from ionic4/Angular8/cordova8 to ionic6/angular14/cordova10.
I get no errors during build.
After upgrading i check apk on a tablet using android 8, everythings is ok (i have network access). But i i test the APK on a Android 9+ devices, i can’t access the API (no network access).
Oldest release use cordova-plugin-whitelist but i need to remove it for building new app and i read that whitelist is not ok with cordova > 10.x
I verify generated AndroidManifest.xml and it contain
<uses-permission android:name="android.permission.INTERNET" />
API use CORS and HTTPS protocol, so it does not seem to be an API problem.
generated AndroidManifest.xml : https://pastebin.com/fSc5UaqM
I also tried adding again cordova-plugin-whitelist but no effect.
I don’t understand why i don’t have network access, any ideas?
Got two additionnal questions:
- API called by the app respond on HTTPS protocol on 9025 port. Is this an issue with android? Is there additinnal permissions to authorize non standard port?
- I change API’s certificate to a let’encrypt cert. Is there a possible problem with let’sencrypt certs?
I solve this problem by adding this base configuration to my
<base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config>
Answered By – Alaindeseine
Answer Checked By – Dawn Plyler (FixeMe Volunteer)