thisisthekap / Xamarin.RevenueCat.Android

MIT License
6 stars 5 forks source link

No Offerings return: Didn't find class "kotlinx.android.parcel.Parceler" #14

Closed shimfish closed 3 years ago

shimfish commented 3 years ago

Affected version: 3.4.1.3

After trying to fetch the offerings, it returns successfully but returns zero offerings. It didn't crash but I noticed these messages in the log:

Rejecting re-init on previously-failed class java.lang.Class<com.revenuecat.purchases.parceler.JSONObjectParceler>: java.lang.NoClassDefFoundError: Failed resolution of: Lkotlinx/android/parcel/Parceler;
   at com.revenuecat.purchases.PurchaserInfo com.revenuecat.purchases.FactoriesKt.buildPurchaserInfo(org.json.JSONObject) (Factories.kt:60)
   at void com.revenuecat.purchases.Backend$getPurchaserInfo$call$1.onCompletion(com.revenuecat.purchases.HTTPClient$Result) (Backend.kt:89)
   at void com.revenuecat.purchases.Dispatcher$AsyncCall.run() (Dispatcher.kt:25)
   at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1167)
   at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:641)
   at void java.lang.Thread.run() (Thread.java:764)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlinx.android.parcel.Parceler" on path: DexPathList[[zip file "/data/app/com.xx.xx-PZJTQZ0dFvYjs1quR7G-2Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.xx.xx-PZJTQZ0dFvYjs1quR7G-2Q==/lib/arm, /data/app/com.xx.xx-PZJTQZ0dFvYjs1quR7G-2Q==/base.apk!/lib/armeabi-v7a, /system/lib]]
   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:134)
   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
   at com.revenuecat.purchases.PurchaserInfo com.revenuecat.purchases.FactoriesKt.buildPurchaserInfo(org.json.JSONObject) (Factories.kt:60)
   at void com.revenuecat.purchases.Backend$getPurchaserInfo$call$1.onCompletion(com.revenuecat.purchases.HTTPClient$Result) (Backend.kt:89)
   at void com.revenuecat.purchases.Dispatcher$AsyncCall.run() (Dispatcher.kt:25)
   at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1167)
   at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:641)
   at void java.lang.Thread.run() (Thread.java:764)

The equivalent REST API call does return the correct results.

thisisthekap commented 3 years ago

@shimfish Please add the equivalent REST api call.

thisisthekap commented 3 years ago

@shimfish Could you please give this nuget a try?

Xamarin.RevenueCat.Android.3.4.1.4-beta1.nupkg.zip

Edit: If the issue persists, try adding Karamunting.Kotlin.Android.Extensions.Runtime with version 1.3.72 to your Xamarin.Android project.

shimfish commented 3 years ago

So I tried with the new package. It still doesn't return any offerings but the error message has gone.

shimfish commented 3 years ago

I'll try some other things to see if there's some other part of my setup that is causing it not to return the offerings.

thisisthekap commented 3 years ago

@shimfish Please let me know if the issue is resolved once you found out.

shimfish commented 3 years ago

Just managed to get this to work. Looks like everything is being returned correctly.

Thanks again for your work.

thisisthekap commented 3 years ago

@shimfish The fix already made it into a public release: https://www.nuget.org/packages/Xamarin.RevenueCat.Android/3.4.1.5