Android Integration Troubleshooting for AWS Lib Crash

If your see a crash related to AWS library in the release version of your application (minifyEnabled field is set to true), trip data might not get uploaded to the Zendrive server. This can happen due to the proguard obfuscation of some XML parsing-related classes used by AWS library, resulting in a crash while uploading trip data.

The crash output can look similar to the following piece of code:

java.lang.NoClassDefFoundError: com.amazonaws.http.StaxResponseHandler
	at com.amazonaws.services.sqs.AmazonSQSClient.u(AmazonSQSClient.java:8)
	at com.amazonaws.services.sqs.AmazonSQSClient.v(AmazonSQSClient.java:6)
	at com.zendrive.sdk.i.c6.c(s:37)
	at com.zendrive.sdk.i.e.b(s:21)
	at com.zendrive.sdk.i.e.a(s:15)
	at com.zendrive.sdk.i.e.c(s:19)
	at com.zendrive.sdk.services.ZendriveWorker.b(s:16)
	at com.zendrive.sdk.services.ZendriveWorker$b$a.invokeSuspend(s:14)
	at kotlin.s.j.a.a.resumeWith(ContinuationImpl.kt:3)
	at kotlinx.coroutines.x0.run(DispatchedTask.kt:22)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ExceptionInInitializerError
	... 13 more
Caused by: com.amazonaws.AmazonClientException: Couldn't initialize XmlPullParserFactory
	at com.amazonaws.

You can fix this crash by adding the following rules in the proguard_rules.txt XML file, as follows:

-dontwarn org.xmlpull.v1.**
-keep class org.xmlpull.** { *; }

After adding these rules to the proguard_rules.txt XML file, rebuild the application and test it. If you still notice the issue, please reach out to the Zendrive Support Team.

Was this helpful?