question-mark

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App Crashing After Adding Library!

See original GitHub issue

Issue Description

I want to use qrcode scanner in my app but when i included this library in pubsec.yaml and restarted my app its startcrashing before and following is my Log! Please Revert As Soon As Possible!

E/AndroidRuntime(32202): FATAL EXCEPTION: main
E/AndroidRuntime(32202): Process: com.siliconleaf.thegrocerstore, PID: 32202
E/AndroidRuntime(32202): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.siliconleaf.thegrocerstore/com.siliconleaf.thegrocerstore.MainActivity}: java.lang.ClassCastException: com.siliconleaf.thegrocerstore.MainActivity cannot be cast to io.flutter.embedding.android.FlutterActivity
E/AndroidRuntime(32202): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782)
E/AndroidRuntime(32202): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3961)
E/AndroidRuntime(32202): 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
E/AndroidRuntime(32202): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
E/AndroidRuntime(32202): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
E/AndroidRuntime(32202): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2386)
E/AndroidRuntime(32202): 	at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(32202): 	at android.os.Looper.loop(Looper.java:213)
E/AndroidRuntime(32202): 	at android.app.ActivityThread.main(ActivityThread.java:8178)
E/AndroidRuntime(32202): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(32202): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
E/AndroidRuntime(32202): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
E/AndroidRuntime(32202): Caused by: java.lang.ClassCastException: com.siliconleaf.thegrocerstore.MainActivity cannot be cast to io.flutter.embedding.android.FlutterActivity
E/AndroidRuntime(32202): 	at com.amolg.flutterbarcodescanner.FlutterBarcodeScannerPlugin.registerWith(FlutterBarcodeScannerPlugin.java:87)
E/AndroidRuntime(32202): 	at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:58)
E/AndroidRuntime(32202): 	at com.siliconleaf.thegrocerstore.MainActivity.onCreate(MainActivity.kt:11)
E/AndroidRuntime(32202): 	at android.app.Activity.performCreate(Activity.java:8086)
E/AndroidRuntime(32202): 	at android.app.Activity.performCreate(Activity.java:8074)
E/AndroidRuntime(32202): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1313)
E/AndroidRuntime(32202): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3755)
E/AndroidRuntime(32202): 	... 11 more


Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kmadisacommented, Nov 7, 2020

I followed these instructions https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects and it solved that problem.

0reactions
AmolGangadharecommented, Apr 25, 2021

With Flutter 2.0 and flutter_barcode_scanner : 2.0.0 this wont be there.

Closing this now, feel free to open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App crash "Library not loaded:" iO… | Apple Developer Forums
I was running into the same problem. Adding CoreSpotlight to "Linked Frameworks", marking it as Optional, and then running Clean Build Folder ( ......
Read more >
App crashes due to module library dependency - Stack Overflow
I have module in Android app. This module uses the Airship library. I have imported this module in my project and used it....
Read more >
Crashes - Android Developers
Stay organized with collections Save and categorize content based on your preferences. An Android app crashes whenever there's an unexpected ...
Read more >
What to Do If Apps Keep Crashing on an Android Device
1. Start the Settings app. · 2. Tap Apps & notifications. · 3. Find the crashing app in the list of apps. You...
Read more >
App crashing after adding RecyclerView Library
It runs at the listing on Page 166, but fails when I run it at P172. I tried to identify the error and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found