0

I have an Android app based on Cordova(10.x.x), which operates perfectly on target-sdk=30 (Android 11) and preceding versions. However, upon upgrading to target-sdk=31 (Android 12), the app experiences challenges in fetching data through HTTP GET requests. I have attempted various approaches for sending such requests, yet the app's behavior remains consistent. What potential solutions exist for this issue?

I have tried: Different approaches to send http get request like (AJAX,XHR, Fetch).

After upgrade to android-12: I can sign-in to the app. App shows android-12 features like precise and approximate location options. The basic UI of the app is working fine, but can't get data, so it finally log-out itself.

On Debugging: Found that the http get requests are unable get data.

Additional info: Cordova version 10.0.0, android-platform 7.0.0, Java JDK 1.8.0, Android target installed: android-30,29,28,26,24 Gradle: 4.6,

Balty
  • 1
  • 2

1 Answers1

0

You can't call HTTP anymore from the webview as it is served as HTTPS with newer versions of Cordova Android. Your best solution is to switch your calls to HTTPS. Otherwise, I'm not sure if the cleartype trick still works but it's worth the try... see Why am I seeing net::ERR_CLEARTEXT_NOT_PERMITTED errors after upgrading to Cordova Android 8?

Eric
  • 9,870
  • 14
  • 66
  • 102