我正在尝试实现 Viewpager ,我添加了支持所需的外部 jar。但是,当我启动应用程序时,我正在逼近。下面是日志。
07-20 18:48:00.578: W/dalvikvm(21560): threadid=1: thread exiting with uncaught exception (group=0x40019740)
07-20 18:48:00.578: E/AndroidRuntime(21560): FATAL EXCEPTION: main
07-20 18:48:00.578: E/AndroidRuntime(21560): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.SimpleViewPager/com.example.SimpleViewPager.SimpleViewPagerActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class android.support.v4.view.ViewPager
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1668)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1684)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.os.Handler.dispatchMessage(Handler.java:99)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.os.Looper.loop(Looper.java:130)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.app.ActivityThread.main(ActivityThread.java:3750)
07-20 18:48:00.578: E/AndroidRuntime(21560): at java.lang.reflect.Method.invokeNative(Native Method)
07-20 18:48:00.578: E/AndroidRuntime(21560): at java.lang.reflect.Method.invoke(Method.java:507)
07-20 18:48:00.578: E/AndroidRuntime(21560): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:861)
07-20 18:48:00.578: E/AndroidRuntime(21560): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:619)
07-20 18:48:00.578: E/AndroidRuntime(21560): at dalvik.system.NativeStart.main(Native Method)
07-20 18:48:00.578: E/AndroidRuntime(21560): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class android.support.v4.view.ViewPager
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-20 18:48:00.578: E/AndroidRuntime(21560): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:224)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.app.Activity.setContentView(Activity.java:1769)
07-20 18:48:00.578: E/AndroidRuntime(21560): at com.example.SimpleViewPager.SimpleViewPagerActivity.onCreate(SimpleViewPagerActivity.java:18)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1632)
07-20 18:48:00.578: E/AndroidRuntime(21560): ... 11 more
07-20 18:48:00.578: E/AndroidRuntime(21560): Caused by: java.lang.ClassNotFoundException: android.support.v4.view.ViewPager in loader dalvik.system.PathClassLoader[/data/app/com.example.SimpleViewPager-1.apk]
07-20 18:48:00.578: E/AndroidRuntime(21560): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
07-20 18:48:00.578: E/AndroidRuntime(21560): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
07-20 18:48:00.578: E/AndroidRuntime(21560): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.view.LayoutInflater.createView(LayoutInflater.java:471)
07-20 18:48:00.578: E/AndroidRuntime(21560): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
07-20 18:48:00.578: E/AndroidRuntime(21560): ... 20 more
07-20 18:48:00.585: D/KeyguardViewMediator(213): setHidden false`