jamesmontemagno / StoreReviewPlugin

Request app store reviews across Xamarin and Windows applications
MIT License
184 stars 24 forks source link

App Crash with IReviewManagerInvoker.RequestReviewFlow () Exception (Android) #20

Closed darrabam closed 3 years ago

darrabam commented 3 years ago

Hi there,

I'm noticing many crash reports logged in my App Center Issues for Android:

IReviewManagerInvoker.RequestReviewFlow ()
Java.Lang.IncompatibleClassChangeError: no non-static method "Lcom/google/android/play/core/review/c;.requestReviewFlow()Lcom/google/android/play/core/tasks/Task;"

Details:

JniEnvironment+InstanceMethods.GetMethodID (Java.Interop.JniObjectReference type, System.String name, System.String signature)
JNIEnv.GetMethodID (System.IntPtr kls, System.String name, System.String signature)
IReviewManagerInvoker.RequestReviewFlow ()
StoreReviewImplementation.RequestReview (System.Boolean testMode)
ItemDetailPage.OnAppearing ()
AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state)
SyncContext+<>c__DisplayClass2_0.<Post>b__0 ()
Thread+RunnableImplementor.Run ()
IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this)
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.102(intptr,intptr)
java.lang.NoSuchMethodError: no non-static method "Lcom/google/android/play/core/review/c;.requestReviewFlow()Lcom/google/android/play/core/tasks/Task;"
mono.android.animation.ValueAnimator_AnimatorUpdateListenerImplementor.n_onAnimationUpdate(Native Method)
mono.android.animation.ValueAnimator_AnimatorUpdateListenerImplementor.onAnimationUpdate()
android.animation.ValueAnimator.animateValue ValueAnimator.java:1346
android.animation.ValueAnimator.animateBasedOnTime ValueAnimator.java:1258
android.animation.ValueAnimator.doAnimationFrame ValueAnimator.java:1306
android.animation.AnimationHandler.doAnimationFrame AnimationHandler.java:146
android.animation.AnimationHandler.-wrap2(AnimationHandler.java)
android.animation.AnimationHandler$1.doFrame AnimationHandler.java:54
android.view.Choreographer$CallbackRecord.run Choreographer.java:957
android.view.Choreographer.doCallbacks Choreographer.java:734
android.view.Choreographer.doFrame Choreographer.java:667
android.view.Choreographer$FrameDisplayEventReceiver.run Choreographer.java:945
android.os.Handler.handleCallback Handler.java:751
android.os.Handler.dispatchMessage Handler.java:95
android.os.Looper.loop Looper.java:154
android.app.ActivityThread.main ActivityThread.java:6776
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run ZygoteInit.java:1520
com.android.internal.os.ZygoteInit.main ZygoteInit.java:1410

Bug

Version Number of Plugin: 3.0.0-beta Device Tested On: Galaxy S8+, OnePlus 6 , Device, Y9 Prime 2019, and others XF: 4.8.0.1560

Steps to reproduce the Behavior

I show the dialog by calling the request review await Plugin.StoreReview.CrossStoreReview.Current.RequestReview(false);

Note that the application language is Arabic.

I don't have a physical device in order try to reproduce it, but I wonder if you could get a hint from the log on what could be the issue.

Thanks,

saamerm commented 3 years ago

@darrabam Whats the Android version on those devices? Android 5.0 or above?

The error says Java.Lang.IncompatibleClassChangeError: no non-static method "Lcom/google/android/play/core/review/c;.requestReviewFlow()Lcom/google/android/play/core/tasks/Task;" so, it could just not be available

Also, do you have a proguard file in your project? Whats the build configuration for it?

darrabam commented 3 years ago

@saamerm Android 7, 8, 9 &10

No, I don't use proguard for my project. These are my build settings: image

saamerm commented 3 years ago

Are you sure that's the release project configuration? I don't believe you can publish an app with Shared Mono Runtime enabled

darrabam commented 3 years ago

@saamerm sorry, you are right, this is the one: image

saamerm commented 3 years ago

If you use proguard or r8, you need to have a proguard file for now so that the shrinker you are using to reduce the size of the APK file doesn't delete those classes.

Please follow the instructions in the readme to add a proguard file and publish a build with that.

I highly recommend that you test the In-App Review using "Android Internal App Sharing" before you publish

saamerm commented 3 years ago

@darrabam ^

darrabam commented 3 years ago

@saamerm thanks for the hint, I'll try that.

saamerm commented 3 years ago

Any success @darrabam

darrabam commented 3 years ago

@saamerm yep, it worked! at least I got the rating dialog and managed to submit a review without a crash :) Thank you very much

saamerm commented 3 years ago

@darrabam you mean without a crash?