之前在GITHUB上看到大蛋的高级设置,昨晚于是就拿来编译..
结果真是个悲伤的故事,放手机上居然运行不了,这种时候只能看LOG了!
看LOG得出的信息如下:
- ::47.438: D/dalvikvm(): threadid=: interp stack at 0x5d2bb000
- ::47.438: D/jdwp(): sendBufferedRequest : len=0x2B
- ::47.455: E/Trace(): error opening trace file: No such file or directory ()
- ::47.457: D/jdwp(): sendBufferedRequest : len=0x45
- ::47.470: D/dalvikvm(): open_cached_dex_file : /data/app/com.focus.advsettings-.apk /data/dalvik-cache/data@app@com.focus.advsettings-.apk@classes.dex
- ::47.473: W/dalvikvm(): Unable to resolve superclass of Lcom/android/settings/focus/DeviceSettings; ()
- ::47.473: W/dalvikvm(): Link of class 'Lcom/android/settings/focus/DeviceSettings;' failed
- ::47.474: D/AndroidRuntime(): Shutting down VM
- ::47.475: W/dalvikvm(): threadid=: thread exiting with uncaught exception (group=0x412d69f0)
- ::47.477: E/AndroidRuntime(): FATAL EXCEPTION: main
- ::47.477: E/AndroidRuntime(): 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]]
- ::47.477: E/AndroidRuntime(): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:)
- ::47.477: E/AndroidRuntime(): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:)
- ::47.477: E/AndroidRuntime(): at android.app.ActivityThread.access$(ActivityThread.java:)
- ::47.477: E/AndroidRuntime(): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:)
- ::47.477: E/AndroidRuntime(): at android.os.Handler.dispatchMessage(Handler.java:)
- ::47.477: E/AndroidRuntime(): at android.os.Looper.loop(Looper.java:)
- ::47.477: E/AndroidRuntime(): at android.app.ActivityThread.main(ActivityThread.java:)
- ::47.477: E/AndroidRuntime(): at java.lang.reflect.Method.invokeNative(Native Method)
- ::47.477: E/AndroidRuntime(): at java.lang.reflect.Method.invoke(Method.java:)
- ::47.477: E/AndroidRuntime(): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:)
- ::47.477: E/AndroidRuntime(): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:)
- ::47.477: E/AndroidRuntime(): at dalvik.system.NativeStart.main(Native Method)
- ::47.477: E/AndroidRuntime(): 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]]
- ::47.477: E/AndroidRuntime(): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:)
- ::47.477: E/AndroidRuntime(): at java.lang.ClassLoader.loadClass(ClassLoader.java:)
- ::47.477: E/AndroidRuntime(): at java.lang.ClassLoader.loadClass(ClassLoader.java:)
- ::47.477: E/AndroidRuntime(): at android.app.Instrumentation.newActivity(Instrumentation.java:)
- ::47.477: E/AndroidRuntime(): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:)
- ::47.477: E/AndroidRuntime(): ... more
谷歌后才知道ADT 17以上如果引用Jar文件就需要放在libs目录上...
可是大蛋已经放好了啊.我就奇怪了~这尼玛是神马回事!!
琢磨了一番后才发现我没有勾上编译libs目录的选项!233333
开启的具体步骤如下:
. 右键项目,选择属性
. Java Build Patch -> Order and Export
. 勾上 Android Private Libraries
. 重新编译即可