解決Android 應用運行報Unable to resolve superclass of L錯誤

來源:互聯網
上載者:User
Android開發中如果將ADT 升級到17以上(包括17),如果你的項目中引用了其它第三方的jar包,在運行是就會報下面的錯誤。這是因為在ADT17以後第三方包統一要放在一個libs的檔案夾中,如果你的第三方包(jar)沒有放在這裡,編譯時間不會將其拷貝到.dex檔案中,因此在運行是會報如下錯誤解決辦法:在你的工程項目下建立一個libs的檔案夾,將jar放到libs檔案夾裡即可。這個問題困擾了好久,開發中一直用的是ADT16,今天終於找到解決辦法了。
08-09 09:58:06.259: W/dalvikvm(1277): Unable to resolve superclass of Lcom/demo/helloworld/widget/viewpagerindicator/simple/BaseSampleActivity; (107)08-09 09:58:06.259: W/dalvikvm(1277): Link of class 'Lcom/demo/helloworld/widget/viewpagerindicator/simple/BaseSampleActivity;' failed08-09 09:58:06.259: W/dalvikvm(1277): Unable to resolve superclass of Lcom/demo/helloworld/widget/viewpagerindicator/simple/SampleCirclesDefault; (451)08-09 09:58:06.259: W/dalvikvm(1277): Link of class 'Lcom/demo/helloworld/widget/viewpagerindicator/simple/SampleCirclesDefault;' failed08-09 09:58:06.259: D/AndroidRuntime(1277): Shutting down VM08-09 09:58:06.259: W/dalvikvm(1277): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)08-09 09:58:06.316: E/AndroidRuntime(1277): FATAL EXCEPTION: main08-09 09:58:06.316: E/AndroidRuntime(1277): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.demo.helloworld/com.demo.helloworld.widget.viewpagerindicator.simple.SampleCirclesDefault}: java.lang.ClassNotFoundException: com.demo.helloworld.widget.viewpagerindicator.simple.SampleCirclesDefault08-09 09:58:06.316: E/AndroidRuntime(1277): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)08-09 09:58:06.316: E/AndroidRuntime(1277): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)08-09 09:58:06.316: E/AndroidRuntime(1277): at android.app.ActivityThread.access$600(ActivityThread.java:123)08-09 09:58:06.316: E/AndroidRuntime(1277): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)08-09 09:58:06.316: E/AndroidRuntime(1277): at android.os.Handler.dispatchMessage(Handler.java:99)08-09 09:58:06.316: E/AndroidRuntime(1277): at android.os.Looper.loop(Looper.java:137)08-09 09:58:06.316: E/AndroidRuntime(1277): at android.app.ActivityThread.main(ActivityThread.java:4424)08-09 09:58:06.316: E/AndroidRuntime(1277): at java.lang.reflect.Method.invokeNative(Native Method)08-09 09:58:06.316: E/AndroidRuntime(1277): at java.lang.reflect.Method.invoke(Method.java:511)08-09 09:58:06.316: E/AndroidRuntime(1277): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)08-09 09:58:06.316: E/AndroidRuntime(1277): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)08-09 09:58:06.316: E/AndroidRuntime(1277): at dalvik.system.NativeStart.main(Native Method)08-09 09:58:06.316: E/AndroidRuntime(1277): Caused by: java.lang.ClassNotFoundException: com.demo.helloworld.widget.viewpagerindicator.simple.SampleCirclesDefault08-09 09:58:06.316: E/AndroidRuntime(1277): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)08-09 09:58:06.316: E/AndroidRuntime(1277): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)08-09 09:58:06.316: E/AndroidRuntime(1277): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)08-09 09:58:06.316: E/AndroidRuntime(1277): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)08-09 09:58:06.316: E/AndroidRuntime(1277): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)08-09 09:58:06.316: E/AndroidRuntime(1277): ... 11 more
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.