1

I am changing my sdk version(on android studio) compileSdkVersion to 29 and taregtSdkversion to 29 as 27 is no more supported and throwing error while uploading in play store, as when it is changed the internet which the app is using is not working

what to do when you change sdk version from 27 to 29 and when i do so the internet which the app is using is not working and it shows offline and when i change it back to 27 then it works fine how to fix as i need to change it to 29 in order to upload it into play store.

android{ compileSdkVersion 27 defaultCofig{ applicationId"com.abc.news" minSdkversion 15 targetSdkVersion 27 versionCode 14 versionname"1.0" } 

How to enable the internet when changing api level to 29 as its not working when I changed it to 29 and I have included the internet permission and network state permission also

5
  • are you testing in pie os Commented Sep 11, 2019 at 11:14
  • 1
    I think you are using http urls add android:usesCleartextTraffic="true" inside application tag of AndroidManifest.xml Commented Sep 11, 2019 at 11:16
  • you may be getting error because your url is not https. do check that. Commented Sep 11, 2019 at 11:21
  • yes now the internet is working but its not showing any text that i have pushed from the admin panel to the front end of the app and this code is working for me android:usesCleartextTraffic="true" Commented Sep 11, 2019 at 11:44
  • stackoverflow.com/questions/53984725/… Commented Sep 11, 2019 at 12:52

2 Answers 2

1

Do you have this in your manifest?

<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
Sign up to request clarification or add additional context in comments.

Comments

0

You should create res folder for xml files in res folder and create in thats file for configs.

network_security_config.xml <?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> </network-security-config> 

And in the end in AndroidManifest file in application tag add this line.

android:networkSecurityConfig="@xml/network_security_config"

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.