flutter_appcenter_bundle icon indicating copy to clipboard operation
flutter_appcenter_bundle copied to clipboard

Newest flutter version unable to run

Open xylim1119 opened this issue 2 years ago • 7 comments

Encountered below error

e: /Users/xxx/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_appcenter_bundle-3.3.2/android/src/main/kotlin/com/github/hanabi1224/flutter_appcenter_bundle/FlutterAppcenterBundlePlugin.kt: (43, 47): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Activity?

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':flutter_appcenter_bundle:compileGooglePlayDebugKotlin'.

Compilation error. See log for more details

xylim1119 avatar May 18 '22 02:05 xylim1119

i'm having the same issue

hussainabbastaqvi avatar May 26 '22 10:05 hussainabbastaqvi

i'm having the same issue too

ivanndrey620 avatar Jun 07 '22 20:06 ivanndrey620

Yup, same for me.

And I get the same error after I downgrade to an older version as well:

C:\Users<username>\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_appcenter_bundle-3.3.1+2\android\src\main\kotlin\com\github\hanabi1224\flutter_appcenter_bundle\FlutterAppcenterBundlePlugin.kt: (43, 47): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Activity?

This all started happening after I upgraded to Flutter 3. I noticed that this library isn't compatible yet, so I reverted to Flutter 2.10.3, but then the problem remains. I tried clearing all kinds of caches, but no luck so far. So basically I am stuck at the moment, or should disable this plugin altogether.

stijnmelis avatar Jun 10 '22 08:06 stijnmelis

The solution is to fix line 43 in the FlutterAppCenterBundlePlugin.kt file
application = registrar.activity()?.application instead of application = registrar.activity().application

is just to add the ?

for the moment it will be necessary to make a fork

ivanndrey620 avatar Jun 14 '22 21:06 ivanndrey620

Good afternoon , is there any other solution for this other than creating a fork ?

GLBekker avatar Jul 27 '22 13:07 GLBekker

hello good afternoon, any solution to the problem?

Thanks

Panchoa87 avatar Sep 03 '22 04:09 Panchoa87

The solution is to fix line 43 in the FlutterAppCenterBundlePlugin.kt file application = registrar.activity()?.application instead of application = registrar.activity().application

is just to add the ?

for the moment it will be necessary to make a fork

@ivanndrey620 I've installed it via pub and I can't find the FlutterAppCenterBundlePlugin.kt file in my project i only have the .dart

do you know where it's located so i can fix this bug ?

Thanks

TxMat avatar Sep 15 '22 07:09 TxMat