最近我無法運行任何Android API的YouTube API演示。 當實例化對YouTube API類具有一定依賴性的第一個活動時,我得到一個ClassNotFoundException。 這發生在任何使用YouTube API的應用程序中。在Android上運行YouTube API演示時未發現類別
我的YouTube應用更新至4.5。+,並且我正在三星Galaxy s3 mini上運行JellyBean。
有沒有我的手機或Eclipse中可能缺少的設置?
[編輯] 這裏是logcat的副本(在Nexus S的這段時間運行):[!解決]
06-18 09:45:26.796: D/libEGL(15140): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
06-18 09:45:26.832: D/libEGL(15140): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
06-18 09:45:26.836: D/libEGL(15140): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
06-18 09:45:26.964: D/OpenGLRenderer(15140): Enabling debug mode 0
06-18 09:45:35.796: W/dalvikvm(15140): Unable to resolve superclass of Lcom/examples/youtubeapidemo/YouTubeFailureRecoveryActivity; (109)
06-18 09:45:35.796: W/dalvikvm(15140): Link of class 'Lcom/examples/youtubeapidemo/YouTubeFailureRecoveryActivity;' failed
06-18 09:45:35.804: W/dalvikvm(15140): Unable to resolve superclass of Lcom/examples/youtubeapidemo/PlayerViewDemoActivity; (102)
06-18 09:45:35.804: W/dalvikvm(15140): Link of class 'Lcom/examples/youtubeapidemo/PlayerViewDemoActivity;' failed
06-18 09:45:35.820: D/AndroidRuntime(15140): Shutting down VM
06-18 09:45:35.820: W/dalvikvm(15140): threadid=1: thread exiting with uncaught exception (group=0x41a1a300)
06-18 09:45:35.855: E/AndroidRuntime(15140): FATAL EXCEPTION: main
06-18 09:45:35.855: E/AndroidRuntime(15140): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.examples.youtubeapidemo/com.examples.youtubeapidemo.PlayerViewDemoActivity}: java.lang.ClassNotFoundException: com.examples.youtubeapidemo.PlayerViewDemoActivity
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.app.ActivityThread.access$600(ActivityThread.java:130)
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.os.Handler.dispatchMessage(Handler.java:99)
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.os.Looper.loop(Looper.java:137)
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.app.ActivityThread.main(ActivityThread.java:4745)
06-18 09:45:35.855: E/AndroidRuntime(15140): at java.lang.reflect.Method.invokeNative(Native Method)
06-18 09:45:35.855: E/AndroidRuntime(15140): at java.lang.reflect.Method.invoke(Method.java:511)
06-18 09:45:35.855: E/AndroidRuntime(15140): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
06-18 09:45:35.855: E/AndroidRuntime(15140): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
06-18 09:45:35.855: E/AndroidRuntime(15140): at dalvik.system.NativeStart.main(Native Method)
06-18 09:45:35.855: E/AndroidRuntime(15140): Caused by: java.lang.ClassNotFoundException: com.examples.youtubeapidemo.PlayerViewDemoActivity
06-18 09:45:35.855: E/AndroidRuntime(15140): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-18 09:45:35.855: E/AndroidRuntime(15140): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-18 09:45:35.855: E/AndroidRuntime(15140): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
06-18 09:45:35.855: E/AndroidRuntime(15140): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
06-18 09:45:35.855: E/AndroidRuntime(15140): ... 11 more
酷我找到了答案。似乎是ADT更新後期的錯誤。此鏈接可以解釋這一切:https://groups.google.com/d/msg/adt-dev/epOfZbKPFdk/v4a-pTbq1OwJ
或者引用它:
項目右鍵 - >屬性> Java構建路徑>排序和導出>檢查Android的私家藏書> OK
然後項目>清除。 ..
並重建/運行。
分享你的完整異常堆棧跟蹤。 –
會ü請發佈logcat錯誤 – abhi
當然你在這裏: –