fluttercommunity / app_review

App Review - Request and Write Reviews and Open Store Listing for Android and iOS in Flutter. Maintainer: @rodydavis
https://fluttercommunity.github.io/app_review/
MIT License
329 stars 108 forks source link

2.0.1: 'Android activity not available' on Android #45

Closed amitkot closed 3 years ago

amitkot commented 3 years ago

Using version 2.0.1, running this code on an Android device with Play Services:

await AppReview.isRequestReviewAvailable

I get:

PlatformException(error, Android activity not available, null)

Note: my app uses pre-1.12 android setup (before Android v2 embedding).

Also, I see that an alternative implementation (https://github.com/britannio/in_app_review) uses the ApplicationContext instead of the Activity one. Wouldn't it be better to do the same instead of keeping a WeakReference to the Activity?

alectogeek commented 3 years ago

Does it happen even when installed from Google Play?

tzachov commented 3 years ago

@amitkot

Also, I see that an alternative implementation (https://github.com/britannio/in_app_review) uses the ApplicationContext instead of the Activity one. Wouldn't it be better to do the same instead of keeping a WeakReference to the Activity?

Tried it and got:

W/ActivityThread(27078): handleWindowVisibility: no activity for token android.os.BinderProxy@eb2aff9
bakua commented 3 years ago

Does it happen even when installed from Google Play?

Hello, yes it does. I have real users running into this issue. Randomly picked user's device it happens on: Device Type Samsung Galaxy S7 Edge, OS android 8.0.0.

shinriyo commented 3 years ago

A problem occurred configuring root project 'app_review'.

rodydavis commented 3 years ago

Does not support every version of android, but there is a fix for it with version 2.1.1

reopen if it is still an issue!