关于安卓zxing项目的使用问题

用了两份zxing模块,一份保留了完整功能作为依赖库,一份是精简版放在主程序模块中,我的构想是主界面有扫码识别、历史记录、分享等功能,还有个跳转的次界面的功能是个数据库的增删查改,使用精简版zxing用于扫码直接输出结果到一个EditView框中方便操作。
代码基本实现,build没有问题,但是run就出问题了,虚拟安卓设备一直显示xx已停止运行,run的错误如下:

 E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.example.zxingdemo, PID: 1969
                  java.lang.RuntimeException: Unable to resume activity {com.example.zxingdemo/com.google.zxing.client.android.CaptureActivity}: java.lang.ClassCastException: com.karics.library.zxing.view.ViewfinderView cannot be cast to com.google.zxing.client.android.ViewfinderView
                      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3645)
                      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3685)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2898)
                      at android.app.ActivityThread.-wrap11(Unknown Source:0)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
                      at android.os.Handler.dispatchMessage(Handler.java:105)
                      at android.os.Looper.loop(Looper.java:164)
                      at android.app.ActivityThread.main(ActivityThread.java:6541)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
                   Caused by: java.lang.ClassCastException: com.karics.library.zxing.view.ViewfinderView cannot be cast to com.google.zxing.client.android.ViewfinderView
                      at com.google.zxing.client.android.CaptureActivity.onResume(CaptureActivity.java:162)
                      at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1354)
                      at android.app.Activity.performResume(Activity.java:7079)
                      at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3620)
                      at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3685) 
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2898) 
                      at android.app.ActivityThread.-wrap11(Unknown Source:0) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
                      at android.os.Handler.dispatchMessage(Handler.java:105) 
                      at android.os.Looper.loop(Looper.java:164) 
                      at android.app.ActivityThread.main(ActivityThread.java:6541) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
I/InactivityTimer: Finishing activity due to inactivity
Application terminated.

萌新求解,,,

这个是类型转换异常。。。。

这么明显的错都看不出来么?你2个ViewfinderView 有一个导错包了,把import删掉,重新导同一个...还有你做扫码的话不建议用虚拟设备,虚拟设备好像扫不成功的,拿真机测试吧

1:如果你的ViewfinderView是在一个单独的项目中,记得把这个单独的项目标记为Is Library(右键 --> properties -->android 在Is Library哪里打钩)
2:在你当前运用的项目中引用上面这个项目,按刚才标记Is Library的方法进入到刚才那个界面,点击add,在弹出的选项里把上面的项目选上。
然后直接在你的xml中引用,就完全没问题,反正我跑项目是没问题。