ravi8x / Barcode-Reader

Android barcode reader using google vision library
BSD 3-Clause "New" or "Revised" License
294 stars 183 forks source link

Class Cast Exception #29

Open iamAbode opened 5 years ago

iamAbode commented 5 years ago

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