Skip to main content

Thank you for creating a crazy useful package.

I use this android library com.revenuecat.purchases:purchases:6.4.0.

Unexpected crash in some users.

The error log is here.

Fatal Exception: org.json.JSONException: Value  of type java.lang.String cannot be converted to JSONObject
       at org.json.JSON.typeMismatch(JSON.java:112)
       at org.json.JSONObject.<init>(JSONObject.java:172)
       at org.json.JSONObject.<init>(JSONObject.java:185)
       at com.revenuecat.purchases.common.diagnostics.DiagnosticsFileHelper.readDiagnosticsFile(DiagnosticsFileHelper.kt:39)
       at com.revenuecat.purchases.common.diagnostics.DiagnosticsSynchronizer.getEventsToSync(DiagnosticsSynchronizer.kt:86)
       at com.revenuecat.purchases.common.diagnostics.DiagnosticsSynchronizer.access$getEventsToSync(DiagnosticsSynchronizer.kt:19)
       at com.revenuecat.purchases.common.diagnostics.DiagnosticsSynchronizer$syncDiagnosticsFileIfNeeded$1.invoke(DiagnosticsSynchronizer.kt:44)
       at com.revenuecat.purchases.common.diagnostics.DiagnosticsSynchronizer$syncDiagnosticsFileIfNeeded$1.invoke(DiagnosticsSynchronizer.kt:42)
       at com.revenuecat.purchases.common.diagnostics.DiagnosticsSynchronizer.enqueue$lambda-0(DiagnosticsSynchronizer.kt:98)
       at com.revenuecat.purchases.common.diagnostics.DiagnosticsSynchronizer.$r8$lambda$mqITcCXi0Ieo366GSfaHWPssYh4()
       at com.revenuecat.purchases.common.diagnostics.DiagnosticsSynchronizer$$ExternalSyntheticLambda0.run(:2)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:463)
       at java.util.concurrent.FutureTask.run(FutureTask.java:264)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
       at com.revenuecat.purchases.PurchasesFactory$LowPriorityThreadFactory.newThread$lambda-1(PurchasesFactory.kt:240)
       at com.revenuecat.purchases.PurchasesFactory$LowPriorityThreadFactory.$r8$lambda$gealA1lBCYgMQlWu9n99TSUZEMU()
       at com.revenuecat.purchases.PurchasesFactory$LowPriorityThreadFactory$$ExternalSyntheticLambda0.run(:2)
       at java.lang.Thread.run(Thread.java:1012)

 

I cant solve this problem.

Please help me to solve.

Hey there @bowyer  👋 thanks for posting! I’m Toni, from the RC team.

Seems that you’re using diagnostics. Do you know if this crash happens in specific Android versions? We are working on a fix in the meantime and that info would help us a lot.

Thanks!


Also, are you able to repro this issue yourself @bowyer? Any other information you can provide would be helpful.


Hey @toni-rico  thanks for reply.

 

Do you know if this crash happens in specific Android versions?

Maybe this crash is device specific.

This issue occurs only Xperia Ace III(Android12)and Pixel 3a(Android12).

Also, are you able to repro this issue yourself

I have Pixel 3a(Android12) but i can't able to repro this issue my device.

This issue occurs customer devices only. 

best regards.


 

This is my Crashlytics report.

According to the report, there is no problem with the condition of the device. No evidence of modification such as root.

The device have sufficient memory and ram space.

If anything is noteworthy, it occurs only with two users.

 


Thanks for the information @bowyer! We just released version 6.5.1 of the Android SDK that should fix the crashes you’re experiencing. Could you try it and let us know?


@toni-rico 

Thank you. I’ll try it.

Could you try it and let us know?

Of course.
I'm releasing it today, so give me a few days.


@toni-rico 

 

After applying the latest SDK 6.5.1, the crashes seem to be gone.
Thank you very much.


Glad that it worked, thanks for letting us know!


Reply