我的第一个Android应用程序崩溃[代码没有变化]

时间:2016-07-17 16:53:06

标签: android android-studio

安装了Android Studio。 创建了新项目。 试图在我的设备上运行该应用程序但是当打开显示“不幸的是,APP已停止”。 当我检查日志猫时,它没有给出任何具体原因。 救命啊!

 07-17 22:41:34.791    1240-1240/tk.bluewire.demo E/Trace﹕ error opening trace file: No such file or directory (2)
07-17 22:41:35.181    1240-1240/tk.bluewire.demo W/dalvikvm﹕ VFY: unable to resolve interface method 15971: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V
07-17 22:41:35.191    1240-1240/tk.bluewire.demo W/dalvikvm﹕ VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
07-17 22:41:35.191    1240-1240/tk.bluewire.demo W/dalvikvm﹕ VFY: unable to resolve interface method 15973: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
07-17 22:41:35.191    1240-1240/tk.bluewire.demo W/dalvikvm﹕ VFY: unable to resolve interface method 15977: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
07-17 22:41:35.191    1240-1240/tk.bluewire.demo W/dalvikvm﹕ VFY: unable to resolve virtual method 444: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
07-17 22:41:35.191    1240-1240/tk.bluewire.demo W/dalvikvm﹕ VFY: unable to resolve virtual method 466: Landroid/content/res/TypedArray;.getType (I)I
07-17 22:41:35.221    1240-1240/tk.bluewire.demo E/VdcInflateDelegate﹕ Exception while inflating <vector>
    org.xmlpull.v1.XmlPullParserException: Binary XML file line #17<vector> 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:708)
            at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:348)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:188)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:181)
            at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:689)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:186)
            at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
            at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:83)
            at android.support.v7.app.AppCompatDelegateImplV7.<init>(AppCompatDelegateImplV7.java:146)
            at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:28)
            at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:41)
            at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:193)
            at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
            at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
            at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
            at tk.bluewire.demo.MainActivity.onCreate(MainActivity.java:12)
            at android.app.Activity.performCreate(Activity.java:5013)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2029)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2090)
            at android.app.ActivityThread.access$600(ActivityThread.java:136)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4802)
            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:813)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:580)
            at dalvik.system.NativeStart.main(Native Method)
07-17 22:41:35.231    1240-1240/tk.bluewire.demo W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x40e02450)
07-17 22:41:35.241    1240-1240/tk.bluewire.demo E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{tk.bluewire.demo/tk.bluewire.demo.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020013
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2065)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2090)
            at android.app.ActivityThread.access$600(ActivityThread.java:136)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4802)
            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:813)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:580)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020013
            at android.content.res.Resources.loadDrawable(Resources.java:1922)
            at android.content.res.Resources.getDrawable(Resources.java:663)
            at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:354)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:181)
            at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:689)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:186)
            at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
            at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:83)
            at android.support.v7.app.AppCompatDelegateImplV7.<init>(AppCompatDelegateImplV7.java:146)
            at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:28)
            at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:41)
            at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:193)
            at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
            at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
            at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
            at tk.bluewire.demo.MainActivity.onCreate(MainActivity.java:12)
            at android.app.Activity.performCreate(Activity.java:5013)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2029)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2090)
            at android.app.ActivityThread.access$600(ActivityThread.java:136)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4802)
            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:813)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:580)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
            at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:884)
            at android.graphics.drawable.Drawable.createFromXml(Drawable.java:822)
            at android.content.res.Resources.loadDrawable(Resources.java:1919)
            at android.content.res.Resources.getDrawable(Resources.java:663)
            at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:354)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:193)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:181)
            at android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:689)
            at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:186)
            at android.support.v7.widget.TintTypedArray.getDrawableIfKnown(TintTypedArray.java:77)
            at android.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:83)
            at android.support.v7.app.AppCompatDelegateImplV7.<init>(AppCompatDelegateImplV7.java:146)
            at android.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:28)
            at android.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:41)
            at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:193)
            at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:173)
            at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:511)
            at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:71)
            at tk.bluewire.demo.MainActivity.onCreate(MainActivity.java:12)
            at android.app.Activity.performCreate(Activity.java:5013)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2029)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2090)
            at android.app.ActivityThread.access$600(ActivityThread.java:136)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4802)
            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:813)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:580)
            at dalvik.system.NativeStart.main(Native Method)
07-17 22:41:35.321    1240-1252/tk.bluewire.demo D/-heap﹕ GC_CONCURRENT freed 308K, 6% free 7873K/8327K, paused 22ms+2ms, total 73ms

1 个答案:

答案 0 :(得分:0)

我遇到了这个问题,但更新到以下版本为我修复了它:

classpath 'com.android.tools.build:gradle:1.5.0'

buildToolsVersion "23.0.2"

模块依赖关系:

compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:support-v4:23.2.0'

compile 'com.google.android.gms:play-services:8.4.0'

来源:T.Coutlakis Update Android Support Library to 23.2.0 cause error: XmlPullParserException Binary XML file line #17<vector> tag requires viewportWidth > 0