I have developed one app using navigation drawer in android. I have even used an external library for spin wheel event. The whole app works on web API. The app is compatible on all versions but getting crash on Pie version. In gradle i have mentioned targetsdkversion:28 but still not working on Pie version.Please help me out App Gradle
-
5Please provide the complete error log. – Jaydroid Mar 05 '19 at 05:12
-
have you added network_security_config ? – VIISHRUT MAVANII Mar 05 '19 at 05:33
-
please provide errors and warnings. – Mohammad Asheri Mar 05 '19 at 05:42
-
@Jaydroid i have published the app on store so dont have the errorlog – Namita Adav Mar 05 '19 at 05:48
-
@VishrutMavani sir im new to android can u please elaborate it – Namita Adav Mar 05 '19 at 05:49
-
I got a similar crash when I installed my app on Pie device. But it's due to the server I used HTTP instead of https. What type of domain are you using? – Brahma Datta Mar 05 '19 at 08:06
-
@g.brahmaDatta i have used HTTP only – Namita Adav Mar 05 '19 at 08:57
-
Then check my answer. It should be Https for Pie devices. I got the crash. Include my answer in your code and it works. @NamitaAdav – Brahma Datta Mar 05 '19 at 09:04
2 Answers
When an app communicates with servers using a cleartext network traffic, such as HTTP, it could raise the risk of eavesdropping and tampering of content. Third parties can inject unauthorized data or leak information about the users. That is why developers are encouraged to secure traffic only, such as HTTPS.
Try this Solution: https://stackoverflow.com/a/54918763/6676310

- 11,410
- 7
- 34
- 49
I Recently had the same issue for Android 9, but I had to use some URLs for different screens. So I added android:usesCleartextTraffic="true" to Manifest and it worked, but we didn't want to compromise the security of the whole app for this. So the fix was in changing links from HTTP to https.But if you had to use only http to communicate with your app then here is your solution.
Use in Manifest application tag
android:networkSecurityConfig="@xml/security_config"
And create a xml file like this.
<network-security-config>
<base-config cleartextTrafficPermitted="true"/>
<debug-overrides>
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</debug-overrides>

- 1,102
- 1
- 12
- 20