Skip to main content
Solved

Fatal Exception: org.json.JSONException occured


Forum|alt.badge.img+3

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.

Best answer by toni-rico

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?

View original
Did this post help you find an answer to your question?

Forum|alt.badge.img+3
  • RevenueCat Staff
  • June 20, 2023

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!


Forum|alt.badge.img+3
  • RevenueCat Staff
  • June 21, 2023

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


Forum|alt.badge.img+3
  • New Member
  • June 21, 2023

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.


Forum|alt.badge.img+3
  • New Member
  • June 21, 2023

 

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.

 


Forum|alt.badge.img+3
  • RevenueCat Staff
  • June 23, 2023

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?


Forum|alt.badge.img+3
  • New Member
  • June 23, 2023

@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.


Forum|alt.badge.img+3
  • New Member
  • June 26, 2023

@toni-rico 

 

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


Forum|alt.badge.img+3
  • RevenueCat Staff
  • June 26, 2023

Glad that it worked, thanks for letting us know!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings