當我在我的Android項目上工作時,我發現Logcat很煩人(不保持滾動條在給定點),並閱讀更新的SDK版本添加一個暫停按鈕來解決這個問題。我更新到SDK版本17,現在我有一些奇怪的問題,我以前沒有。我刪除並添加了android支持庫,但沒有運氣。我一直在閱讀互聯網,但我仍然無法弄清楚。日誌在下面。更新的SDK版本,獲取ClassNotFoundException:android.support.v4.view.ViewPager
03-22 15:54:18.558: E/AndroidRuntime(11597): FATAL EXCEPTION: main
03-22 15:54:18.558: E/AndroidRuntime(11597): java.lang.RuntimeException: Unable to start activity ComponentInfo{kris.android/kris.android.ActivityPortfolio}: android.view.InflateException: Binary XML file line #184: Error inflating class android.support.v4.view.ViewPager
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1821)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1842)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.app.ActivityThread.access$1500(ActivityThread.java:132)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.os.Handler.dispatchMessage(Handler.java:99)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.os.Looper.loop(Looper.java:150)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.app.ActivityThread.main(ActivityThread.java:4263)
03-22 15:54:18.558: E/AndroidRuntime(11597): at java.lang.reflect.Method.invokeNative(Native Method)
03-22 15:54:18.558: E/AndroidRuntime(11597): at java.lang.reflect.Method.invoke(Method.java:507)
03-22 15:54:18.558: E/AndroidRuntime(11597): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-22 15:54:18.558: E/AndroidRuntime(11597): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-22 15:54:18.558: E/AndroidRuntime(11597): at dalvik.system.NativeStart.main(Native Method)
03-22 15:54:18.558: E/AndroidRuntime(11597): Caused by: android.view.InflateException: Binary XML file line #184: Error inflating class android.support.v4.view.ViewPager
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
03-22 15:54:18.558: E/AndroidRuntime(11597): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:231)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.app.Activity.setContentView(Activity.java:1742)
03-22 15:54:18.558: E/AndroidRuntime(11597): at kris.android.ActivityPortfolio.onCreate(ActivityPortfolio.java:44)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1785)
03-22 15:54:18.558: E/AndroidRuntime(11597): ... 11 more
03-22 15:54:18.558: E/AndroidRuntime(11597): Caused by: java.lang.ClassNotFoundException: android.support.v4.view.ViewPager in loader dalvik.system.PathClassLoader[/data/app/kris.android-2.apk]
03-22 15:54:18.558: E/AndroidRuntime(11597): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
03-22 15:54:18.558: E/AndroidRuntime(11597): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
03-22 15:54:18.558: E/AndroidRuntime(11597): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.view.LayoutInflater.createView(LayoutInflater.java:471)
03-22 15:54:18.558: E/AndroidRuntime(11597): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
03-22 15:54:18.558: E/AndroidRuntime(11597): ... 21 more
[Android-SDK r17遺留工作項目]的可能重複(http://stackoverflow.com/questions/9824491/android-sdk-r17-ruins-working-projects) – 2012-03-22 21:47:27
答案下面解決了這個問題。 – wdziemia 2012-03-22 22:07:01