解决Unable to resolve superclass的问题
之前在GITHUB上看到大蛋的高级设置,昨晚于是就拿来编译..
结果真是个悲伤的故事,放手机上居然运行不了,这种时候只能看LOG了!
看LOG得出的信息如下:
07-01 13:35:47.438: D/dalvikvm(2286): threadid=10: interp stack at 0x5d2bb000 07-01 13:35:47.438: D/jdwp(2286): sendBufferedRequest : len=0x2B 07-01 13:35:47.455: E/Trace(2286): error opening trace file: No such file or directory (2) 07-01 13:35:47.457: D/jdwp(2286): sendBufferedRequest : len=0x45 07-01 13:35:47.470: D/dalvikvm(2286): open_cached_dex_file : /data/app/com.focus.advsettings-1.apk /data/dalvik-cache/data@app@com.focus.advsettings-1.apk@classes.dex 07-01 13:35:47.473: W/dalvikvm(2286): Unable to resolve superclass of Lcom/android/settings/focus/DeviceSettings; (47) 07-01 13:35:47.473: W/dalvikvm(2286): Link of class 'Lcom/android/settings/focus/DeviceSettings;' failed 07-01 13:35:47.474: D/AndroidRuntime(2286): Shutting down VM 07-01 13:35:47.475: W/dalvikvm(2286): threadid=1: thread exiting with uncaught exception (group=0x412d69f0) 07-01 13:35:47.477: E/AndroidRuntime(2286): FATAL EXCEPTION: main 07-01 13:35:47.477: E/AndroidRuntime(2286): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.focus.advsettings/com.android.settings.focus.DeviceSettings}: java.lang.ClassNotFoundException: Didn't find class "com.android.settings.focus.DeviceSettings" on path: DexPathList[dexElements=[zip file "/data/app/com.focus.advsettings-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.focus.advsettings-1, /vendor/lib, /system/lib]] 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236) 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362) 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.app.ActivityThread.access$600(ActivityThread.java:160) 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.os.Handler.dispatchMessage(Handler.java:99) 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.os.Looper.loop(Looper.java:153) 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.app.ActivityThread.main(ActivityThread.java:5317) 07-01 13:35:47.477: E/AndroidRuntime(2286): at java.lang.reflect.Method.invokeNative(Native Method) 07-01 13:35:47.477: E/AndroidRuntime(2286): at java.lang.reflect.Method.invoke(Method.java:511) 07-01 13:35:47.477: E/AndroidRuntime(2286): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) 07-01 13:35:47.477: E/AndroidRuntime(2286): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) 07-01 13:35:47.477: E/AndroidRuntime(2286): at dalvik.system.NativeStart.main(Native Method) 07-01 13:35:47.477: E/AndroidRuntime(2286): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.settings.focus.DeviceSettings" on path: DexPathList[dexElements=[zip file "/data/app/com.focus.advsettings-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.focus.advsettings-1, /vendor/lib, /system/lib]] 07-01 13:35:47.477: E/AndroidRuntime(2286): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53) 07-01 13:35:47.477: E/AndroidRuntime(2286): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 07-01 13:35:47.477: E/AndroidRuntime(2286): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.app.Instrumentation.newActivity(Instrumentation.java:1054) 07-01 13:35:47.477: E/AndroidRuntime(2286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227) 07-01 13:35:47.477: E/AndroidRuntime(2286): ... 11 more
谷歌后才知道ADT 17以上如果引用Jar文件就需要放在libs目录上...
可是大蛋已经放好了啊.我就奇怪了~这尼玛是神马回事!!
琢磨了一番后才发现我没有勾上编译libs目录的选项!233333
开启的具体步骤如下:
1. 右键项目,选择属性 2. Java Build Patch -> Order and Export 3. 勾上 Android Private Libraries 4. 重新编译即可
posted on 2013-08-12 23:07 GentlemanMod 阅读(3323) 评论(1) 编辑 收藏 举报