我试图将Android导航抽屉与页面(寻呼机)滑动标签条(https://github.com/Balaji-K13/Navigation-drawer-page-sliding-tab-strip)一起使用,但我无法使其正常工作。我正在使用android studio。我在主项目中进行了导入,并没有显示任何错误,但是当我遇到设备(虚拟或真实)时会出现此错误:
05-22 10:38:20.200 1434-1434/com.webileapps.navdrawer E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.webileapps.navdrawer, PID: 1434
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.webileapps.navdrawer/com.webileapps.navdrawer.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.webileapps.navdrawer.MainActivity" on path: DexPathList[[zip file "/data/app/com.webileapps.navdrawer-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.webileapps.navdrawer-1, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2102)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
at android.app.ActivityThread.access$700(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4998)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.webileapps.navdrawer.MainActivity" on path: DexPathList[[zip file "/data/app/com.webileapps.navdrawer-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.webileapps.navdrawer-1, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2093)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
at android.app.ActivityThread.access$700(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4998)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
at dalvik.system.NativeStart.main(Native Method)
那么,想法?
答案 0 :(得分:0)
我也试图实现它并得到了同样的错误。经过很多努力,我能够运行它但收到了你收到的类似错误。
我解决了这个问题
1:关闭并开始你的日食。
2:在所有库项目中复制主项目的v4 jar并删除现有项目。
该错误是由于supportv4jar不匹配造成的。制作相同版本的所有supportv4jar
3:之后删除gen和bin文件夹并清理项目并运行。