05-26 07:19:35.908: W/dalvikvm(631): VFY: unable to find class referenced in signature (Landroid/support/v4/view/ViewPager;)
05-26 07:19:35.928: E/dalvikvm(631): Could not find class 'android.support.v4.view.ViewPager', referenced from method com.zhangyuzun.supersmsmanager.ViewPagerActivity.initViewPager
05-26 07:19:35.928: W/dalvikvm(631): VFY: unable to resolve check-cast 27 (Landroid/support/v4/view/ViewPager;) in Lcom/zhangyuzun/supersmsmanager/ViewPagerActivity;
05-26 07:19:35.928: D/dalvikvm(631): VFY: replacing opcode 0x1f at 0x0008
05-26 07:19:35.939: D/dalvikvm(631): VFY: dead code 0x000a-0069 in Lcom/zhangyuzun/supersmsmanager/ViewPagerActivity;.initViewPager ()V
05-26 07:19:36.220: D/dalvikvm(631): GC_EXTERNAL_ALLOC freed 54K, 53% free 2543K/5379K, external 716K/1038K, paused 162ms
05-26 07:19:36.349: D/AndroidRuntime(631): Shutting down VM
05-26 07:19:36.349: W/dalvikvm(631): threadid=1: thread exiting with uncaught exception (group=0x40015560)
05-26 07:19:36.428: E/AndroidRuntime(631): FATAL EXCEPTION: main
05-26 07:19:36.428: E/AndroidRuntime(631): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.zhangyuzun.supersmsmanager/com.zhangyuzun.supersmsmanager.ViewPagerActivity}: android.view.InflateException: Binary XML file line #55: Error inflating class android.support.v4.view.ViewPager
05-26 07:19:36.428: E/AndroidRuntime(631): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.os.Handler.dispatchMessage(Handler.java:99)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.os.Looper.loop(Looper.java:123)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.app.ActivityThread.main(ActivityThread.java:3683)
05-26 07:19:36.428: E/AndroidRuntime(631): at java.lang.reflect.Method.invokeNative(Native Method)
05-26 07:19:36.428: E/AndroidRuntime(631): at java.lang.reflect.Method.invoke(Method.java:507)
05-26 07:19:36.428: E/AndroidRuntime(631): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-26 07:19:36.428: E/AndroidRuntime(631): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-26 07:19:36.428: E/AndroidRuntime(631): at dalvik.system.NativeStart.main(Native Method)
05-26 07:19:36.428: E/AndroidRuntime(631): Caused by: android.view.InflateException: Binary XML file line #55: Error inflating class android.support.v4.view.ViewPager
05-26 07:19:36.428: E/AndroidRuntime(631): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
05-26 07:19:36.428: E/AndroidRuntime(631): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.app.Activity.setContentView(Activity.java:1657)
05-26 07:19:36.428: E/AndroidRuntime(631): at com.zhangyuzun.supersmsmanager.ViewPagerActivity.onCreate(ViewPagerActivity.java:45)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
05-26 07:19:36.428: E/AndroidRuntime(631): ... 11 more
05-26 07:19:36.428: E/AndroidRuntime(631): Caused by: java.lang.ClassNotFoundException: android.support.v4.view.ViewPager in loader dalvik.system.PathClassLoader[/data/app/com.zhangyuzun.supersmsmanager-2.apk]
05-26 07:19:36.428: E/AndroidRuntime(631): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-26 07:19:36.428: E/AndroidRuntime(631): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-26 07:19:36.428: E/AndroidRuntime(631): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.view.LayoutInflater.createView(LayoutInflater.java:471)
05-26 07:19:36.428: E/AndroidRuntime(631): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
05-26 07:19:36.428: E/AndroidRuntime(631): ... 20 more
05-26 07:19:40.217: I/Process(631): Sending signal. PID: 631 SIG: 9
===========================================
xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/background"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dip"
android:gravity="center"
android:layout_weight="1"
android:onClick="tv1OnClick"
android:text="标签1"/>
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dip"
android:gravity="center"
android:layout_weight="1"
android:onClick="tv2OnClick"
android:text="标签2"/>
<TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dip"
android:gravity="center"
android:layout_weight="1"
android:onClick="tv3OnClick"
android:text="标签3"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FCFCFA">
<ImageView
android:id="@+id/slide1"
android:layout_width="110dip"
android:layout_height="5dip"
android:src="@drawable/slide1"/>
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/vPager"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
</LinearLayout>
现在问题解决了,方法:
在项目的properties中的Java Build Path里将Order and Export里的android-support-v4.jar勾选上
我想知道为什么会这样???????
重新导入后,整个项目的引用jar的路径发生了变化,所以你要重新到order and Export里面选上,最好是我们建立一个lib(s)文件夹,把引用的jar放在里面,下次就不会有这个问题了。希望对你有帮助。
谢谢!
还是没用。。求破。。