今天遇到這樣一個bug:java
java.lang.VerifyError:
at android.support.v4.view.ViewPager.infoForAnyChild(ViewPager.java)
at android.support.v4.view.ViewPager.populate(ViewPager.java:1044)
at android.support.v4.view.ViewPager.populate(ViewPager.java:880)
at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1374)
at android.view.View.measure(View.java:12723)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:594)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:376)
at android.view.View.measure(View.java:12723)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4724)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
at android.view.View.measure(View.java:12723)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4724)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1378)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:660)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)
at android.view.View.measure(View.java:12723)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4724)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2109)
at android.view.View.measure(View.java:12723)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1064)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2453)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:4503)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:830)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
網上大概有下面幾種說法: android
1. 大多數可能引用的外部jar文件出現了問題,好比說package的路徑產生了問題,但該類被class文件定義了。安全
2. 調用了一些編譯器產生異議的問題,多是使用的sdk版本不一樣,但源代碼是一些更老版本的定義。app
三、java.lang.VerifyError是說當「校驗器」檢測到一個類文件雖然格式正確,但包含着一些內部不一致性或安全性問題時,拋出該錯誤。這個是有jdk版本的問題引發的eclipse
有人說經過更改添加jar包的方式,能夠解決。把add library改成User library的方式,而後把相應的自定義庫在order and export裏面勾上,而且注意把自定義包放在android包前面,問題解決。ide
我的認爲出現這個異常的緣由跟可能跟Android ADT版本有關係。oop
實際上就是,高版本ADT運行低版本ADT建立的工程可能拋java.lang.VerifyError異常,簡單的解決方法是在.classpath文件中添加:
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>spa