03-23 02:25:43.682 1726-1726/? D/dalvikvm: Late-enabling CheckJNI 03-23 02:25:44.182 1726-1726/com.example.chenxuanhe.myapplication W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;) 03-23 02:25:44.214 1726-1726/com.example.chenxuanhe.myapplication I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested 03-23 02:25:44.214 1726-1726/com.example.chenxuanhe.myapplication W/dalvikvm: VFY: unable to resolve interface method 15025: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z 03-23 02:25:44.218 1726-1726/com.example.chenxuanhe.myapplication D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 03-23 02:25:44.222 1726-1726/com.example.chenxuanhe.myapplication I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode 03-23 02:25:44.226 1726-1726/com.example.chenxuanhe.myapplication W/dalvikvm: VFY: unable to resolve interface method 15029: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode; 03-23 02:25:44.230 1726-1726/com.example.chenxuanhe.myapplication D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 03-23 02:25:44.338 1726-1726/com.example.chenxuanhe.myapplication I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations 03-23 02:25:44.366 1726-1726/com.example.chenxuanhe.myapplication W/dalvikvm: VFY: unable to resolve virtual method 396: Landroid/content/res/TypedArray;.getChangingConfigurations ()I 03-23 02:25:44.366 1726-1726/com.example.chenxuanhe.myapplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 03-23 02:25:44.374 1726-1726/com.example.chenxuanhe.myapplication I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType 03-23 02:25:44.374 1726-1726/com.example.chenxuanhe.myapplication W/dalvikvm: VFY: unable to resolve virtual method 418: Landroid/content/res/TypedArray;.getType (I)I 03-23 02:25:44.378 1726-1726/com.example.chenxuanhe.myapplication D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 03-23 02:25:44.442 1726-1726/com.example.chenxuanhe.myapplication E/VdcInflateDelegate: Exception while inflating org.xmlpull.v1.XmlPullParserException: Binary XML file line #17 tag requires viewportWidth > 0 at android.support.graphics.drawable.VectorDrawableCompat.updateStateFromTypedArray(VectorDrawableCompat.java:535) at android.support.graphics.drawable.VectorDrawableCompat.inflate(VectorDrawableCompat.java:472) at android.support.graphics.drawable.VectorDrawableCompat.createFromXmlInner(VectorDrawableCompat.java:436) at android.support.v7.widget.AppCompatDrawableManager$VdcInflateDelegate.createFromXmlInner(AppCompatDrawableManager.java:829) at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:303) at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:178) at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:173) at android.support.v7.widget.TintTypedArray.getDrawable(TintTypedArray.java:60) at android.support.v7.widget.Toolbar.(Toolbar.java:254) at android.support.v7.widget.Toolbar.(Toolbar.java:196) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:594) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at android.view.LayoutInflater.inflate(LayoutInflater.java:353) at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:379) at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:300) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:264) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:129) at com.example.chenxuanhe.myapplication.MainActivity.onCreate(MainActivity.java:11) at android.app.Activity.performCreate(Activity.java:5231) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5001) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method)
解决方案
40
gradle版本2.0或以上,在app/build.gradle中添加:
android { defaultConfig { vectorDrawables.useSupportLibrary = true } }
gradle版本1.5或以下,在app/build.gradle中添加:
android { defaultConfig { // Stops the Gradle plugin’s automatic rasterization of vectors generatedDensities = [] } // Flag to tell aapt to keep the attribute ids around aaptOptions { additionalParameters "--no-version-vectors" } }
出处:http://android-developers.blogspot.com/2016/02/android-support-library-232.html