在更新我的库之前,我的代码工作正常。我更新了库以支持一些新功能。新功能运行良好,但是当我测试旧功能时,它会崩溃,并显示以下错误消息。
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.siemens.solidedge.viewer, PID: 2917
java.lang.IncompatibleClassChangeError: Structural change of android.support.v4.view.PagerAdapter is hazardous (/data/user/0/com.siemens.solidedge.viewer/cache/slice-android-support-v13_0d236b8e445f6b717cc6b3d71f12228242900e27-classes.dex at compile time, /data/user/0/com.siemens.solidedge.viewer/cache/slice-com.android.support-support-core-ui-25.0.0_4b8934deabed056f9d3bb10bda50dc400f9b3a59-classes.dex at runtime): Virtual method count off: 20 vs 21
Landroid/support/v4/view/PagerAdapter; (Compile time):
Static fields:
I POSITION_NONE
I POSITION_UNCHANGED
Instance fields:
Landroid/database/DataSetObservable; mObservable
Direct methods:
<init>()V
Virtual methods:
destroyItem(Landroid/view/View;ILjava/lang/Object;)V
destroyItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
finishUpdate(Landroid/view/View;)V
finishUpdate(Landroid/view/ViewGroup;)V
getCount()I
getItemPosition(Ljava/lang/Object;)I
getPageTitle(I)Ljava/lang/CharSequence;
getPageWidth(I)F
instantiateItem(Landroid/view/View;I)Ljava/lang/Object;
instantiateItem(Landroid/view/ViewGroup;I)Ljava/lang/Object;
isViewFromObject(Landroid/view/View;Ljava/lang/Object;)Z
notifyDataSetChanged()V
registerDataSetObserver(Landroid/database/DataSetObserver;)V
restoreState(Landroid/os/Parcelable;Ljava/lang/ClassLoader;)V
saveState()Landroid/os/Parcelable;
setPrimaryItem(Landroid/view/View;ILjava/lang/Object;)V
setPrimaryItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
startUpdate(Landroid/view/View;)V
startUpdate(Landroid/view/ViewGroup;)V
unregisterDataSetObserver(Landroid/database/DataSetObserver;)V
Landroid/support/v4/view/PagerAdapter; (Runtime):
Static fields:
I POSITION_NONE
I POSITION_UNCHANGED
Instance fields:
Landroid/database/DataSetObservable; mObservable
Landroid/database/DataSetObserver; mViewPagerObserver
Direct methods:
<init>()V
Virtual methods:
destroyItem(Landroid/view/View;ILjava/lang/Object;)V
destroyItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
finishUpdate(Landroid/view/View;)V
finishUpdate(Landroid/view/ViewGroup;)V
getCount()I
getItemPosition(Ljava/lang/Object;)I
getPageTitle(I)Ljava/lang/CharSequence;
getPageWidth(I)F
instantiateItem(Landroid/view/View;I)Ljava/lang/Object;
instantiateItem(Landroid/view/ViewGroup;I)Ljava/lang/Object;
isViewFromObject(Landroid/view/View;Ljava/lang/Object;)Z
notifyDataSetChanged()V
registerDataSetObserver(Landroid/database/DataSetObserver;)V
restoreState(Landroid/os/Parcelable;Ljava/lang/ClassLoader;)V
saveState()Landroid/os/Parcelable;
setPrimaryItem(Landroid/view/View;ILjava/lang/Object;)V
setPrimaryItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
setViewPagerObserver(Landroid/database/DataSetObserver;)V
startUpdate(Landroid/view/View;)V
startUpdate(Landroid/view/ViewGroup;)V
unregisterDataSetObserver(Landroid/database/DataSetObserver;)V
(declaration of 'android.support.v13.app.FragmentStatePagerAdapter' appears in /data/data/com.siemens.solidedge.viewer/files/instant-run/dex/slice-android-support-v13_0d236b8e445f6b717cc6b3d71f12228242900e27-classes.dex)
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:296)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:289)
at dalvik.system.DexPathList.findClass(DexPathList.java:418)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
at com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:90)
at com.android.tools.fd.runtime.IncrementalClassLoader.findClass(IncrementalClassLoader.java:62)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:367)
at java.lang.ClassLoader.loadClass(ClassLoader.java:367)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at dalvik.system.DexFile.defineClassNative(Native Method)
E/AndroidRuntime: at dalvik.system.DexFile.defineClass(DexFile.java:296)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:289)
at dalvik.system.DexPathList.findClass(DexPathList.java:418)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
at com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:90)
at com.android.tools.fd.runtime.IncrementalClassLoader.findClass(IncrementalClassLoader.java:62)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:367)
at java.lang.ClassLoader.loadClass(ClassLoader.java:367)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Application terminated.