Closed mathrocco closed 6 days ago
Hey, thanks for the PR. If this step can be handled by the package then it'd save some time for developers. Is this line not already sufficient? https://github.com/britannio/in_app_review/blob/master/in_app_review/android/build.gradle#L48
Hey, thanks for the PR. If this step can be handled by the package then it'd save some time for developers. Is this line not already sufficient? https://github.com/britannio/in_app_review/blob/master/in_app_review/android/build.gradle#L48
Thanks for the fast response @britannio. These changes need to be done in the app build.gradle
file, otherwise the dependency won't be imported, like it says here: https://docs.flutter.dev/add-to-app/android/plugin-setup#b-plugins-needing-project-edits
Btw, I think this Gradle file you mentioned isn't even being used by the package, so I suggest trying to remove it https://docs.flutter.dev/packages-and-plugins/developing-packages
@britannio about making setup easier, I noticed that Firebase for instance uses its CLI to help with that. But they have a wide variety of packages. In the case of one single package, I think it may be easier to perform it manually instead. Take a look on https://pub.dev/packages/espresso for instance
Btw, I think this Gradle file you mentioned isn't even being used by the package, so I suggest trying to remove it https://docs.flutter.dev/packages-and-plugins/developing-packages
It has an example of firebase_crashlytics that points to this line: https://github.com/firebase/flutterfire/blob/bdb95fcacf7cf077d162d2f267eee54a8b0be3bc/packages/firebase_crashlytics/android/build.gradle#L40
Then again, crashlytics also requires users to modify android/build.gradle
but with a separate dependency.
Now I'm curious as to why build.gradle
must be modified for Crashlytics but not other Firebase libraries.
https://firebase.google.com/docs/auth/android/start#add_to_your_app
Now I'm curious as to why
build.gradle
must be modified for Crashlytics but not other Firebase libraries.https://firebase.google.com/docs/auth/android/start#add_to_your_app
There's other plugin from firebase that requires these changes, but according to this doc this is handled by the flutterfire CLI
There's other plugin from firebase that requires these changes, but according to this doc this is handled by the flutterfire CLI
But why not Firebase auth? Developers of a native app need to add it but unless I'm mistaken, it isn't automatically added by the flutterfire cli.
I had a look at similar packages for other hybrid app frameworks and while they could be making the same mistake, the main difference is the additional dependency on com.google.android.gms:play-services-base
so maybe this is the fix?
https://github.com/MinaSamir11/react-native-in-app-review/blob/master/android/build.gradle#L74-L75
@mathrocco The link you posted is documentation about app-to-app configurations, which is when you have an existing Android native project and you want to use Flutter for a specific part in the project.
Normally the only required changes in the android configuration outside the plugin are the Gradle plugins, not Gradle dependencies, which are automatically included.
In the case of crashlytics they have a Gradle plugin and a Gradle dependency. When using the package, the user only needs to include the Gradle plugin explicitly.
I don't think this change is needed at all, although I might be mistaken. Just wanted to share my take on what the link refers to 🙂
I have added com.google.android.gms:play-services-base
as a gradle dependency because the in-app-review packages for other hybrid frameworks do the same. Hopefully, this fixes the issue @mathrocco was facing. If not, it should not break anything.
I have added
com.google.android.gms:play-services-base
as a gradle dependency because the in-app-review packages for other hybrid frameworks do the same. Hopefully, this fixes the issue @mathrocco was facing. If not, it should not break anything.
Based on https://github.com/britannio/in_app_review/commit/d258bcba8f2f1e453d52c71451ec9f84b327fb37#commitcomment-127538410, the additional dependency is unlikely to be the fix.
@mathrocco Maybe you could test out the package again without your change and then with it afterwards to rule out any other effect. There's actually a long list of reasons why requestReview()
may not work on Android: https://developer.android.com/guide/playcore/in-app-review/test#troubleshooting.
@mathrocco Maybe you could test out the package again without your change and then with it afterwards to rule out any other effect. There's actually a long list of reasons why
requestReview()
may not work on Android: https://developer.android.com/guide/playcore/in-app-review/test#troubleshooting.
@britannio I have tested these changes I proposed and it only worked after I added the dependencies. I did double check it re-installing a version without build.gradle
changes after I made it work and the in-app-review banner didn't appear anymore.
I can test it again with this change you've introduced here to see if this is going to work and let you know.
Also, later next week I'll be able to see the real impact in production of my changes and I let you know 👍🏼
@mathrocco what did you find out?
I'm having possibly related issues with a dependency mismatch, have you guys seen this one before?
Duplicate class com.google.android.play.core.review.ReviewException found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
Any update on this? Is this still needed?
Add Android setup instructions to solve issues for package users https://docs.flutter.dev/add-to-app/android/plugin-setup#b-plugins-needing-project-edits