AmolGangadhare / flutter_barcode_scanner

Barcode scanner plugin for flutter. Supports barcode scanning for Android and iOS
https://pub.dev/packages/flutter_barcode_scanner
MIT License
379 stars 453 forks source link

Android Release app crashes on start up #106

Open webalexx opened 4 years ago

webalexx commented 4 years ago

Describe the bug The old bug takes place again (https://github.com/AmolGangadhare/flutter_barcode_scanner/issues/65)

with Flutter version: 1.17.5 flutter_barcode_scanner: 1.0.0

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.namespace.100/com.namespace.100.MainActivity}: java.lang.ClassCastException: com.namespace.100.MainActivity cannot be cast to io.flutter.embedding.android.d
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3304)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3443)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2040)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:224)
    at android.app.ActivityThread.main(ActivityThread.java:7520)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: java.lang.ClassCastException: com.namespace.100.MainActivity cannot be cast to io.flutter.embedding.android.d
    at com.amolg.flutterbarcodescanner.FlutterBarcodeScannerPlugin.a(Unknown Source:35)
    at f.a.c.a.b(Unknown Source:31)
    at com.namespace.100.MainActivity.onCreate(Unknown Source:3)
    at android.app.Activity.performCreate(Activity.java:7893)
    at android.app.Activity.performCreate(Activity.java:7880)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3279)
    ... 11 more

To Reproduce Steps to reproduce the behavior:

  1. try to start app on any emulator's version

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2020-07-06 at 16 26 23

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

tc14077 commented 4 years ago

Is it correlated with my issue (#103)? I face this issue too after I updated the package version to ^1.0.0

msandwidi commented 4 years ago

I have the same issue when upgrading from 0.7.1 to 1.0.0.

AmolGangadhare commented 4 years ago

@webalexx what is flutter SDK version you are using currently?

This issue is unfortunate as this issue was fixed with the migration guide provided by the flutter team.

soliven25 commented 4 years ago

@AmolGangadhare I have the same issue too. (I tried $flutter clean) Which migration guide are you referring to?

I'm using the below flutter version. Thanks~

Flutter 1.17.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision 8af6b2f038 (4 weeks ago) • 2020-06-30 12:53:55 -0700 Engine • revision ee76268252 Tools • Dart 2.8.4

soliven25 commented 3 years ago

https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects I followed the instruction above, and it solved my problem.

AmolGangadhare commented 3 years ago

Is this issue still persists on Flutter 2.0?

msandwidi commented 3 years ago

Is this issue still persists on Flutter 2.0?

Mine is solved. Thank you

mahdinazmi commented 2 years ago

Is this issue still persists on Flutter 2.0?

Mine is solved. Thank you

How did you solve this problem?