Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class Cast Exception #29

Open
iamAbode opened this issue Feb 25, 2019 · 0 comments
Open

Class Cast Exception #29

iamAbode opened this issue Feb 25, 2019 · 0 comments

Comments

@iamAbode
Copy link

I configured the project based on the instruction in the readme file and am getting the following error

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.barcode_reader2/com.example.barcode_reader2.MainActivity}: java.lang.ClassCastException: info.androidhive.barcode.BarcodeReader cannot be cast to com.example.barcode_reader2.BarcodeReader
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
    at android.app.ActivityThread.-wrap12(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
 Caused by: java.lang.ClassCastException: info.androidhive.barcode.BarcodeReader cannot be cast to com.example.barcode_reader2.BarcodeReader
    at com.example.barcode_reader2.MainActivity.onCreate(MainActivity.java:22)
    at android.app.Activity.performCreate(Activity.java:6662)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)

How do i resolve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant