【问题标题】:Appcompat, crash on start - invalid drawable tag vectorAppcompat,启动时崩溃 - 无效的可绘制标签矢量
【发布时间】:2016-12-11 16:12:06
【问题描述】:

启动我的应用时出现错误

    ...
        Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v7.widget.Toolbar
    ...
        Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020013
    ...
        Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector

我的 build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
    }
}

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.1'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 25
        multiDexEnabled true
        vectorDrawables.useSupportLibrary true
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.android.support:preference-v14:25.0.1'
    compile 'com.android.support:preference-v7:25.0.1'
    compile 'com.android.support:recyclerview-v7:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'
}

我没有使用矢量绘图,因此代码中没有相关错误。已经尝试了所有可能的答案。应用程序继续在 API 上崩溃

【问题讨论】:

  • 你有什么 gradle 插件? stackoverflow.com/questions/35739743/…
  • 你没有使用矢量绘图,不,但支持库可以
  • 更新了我的问题
  • useSupportLibrary = true 需要等号吗?
  • 有必要吗?没关系,我也试过这个标志

标签: android android-support-library


【解决方案1】:

解决了这个问题。就我而言,问题在于我应用到工具栏的应用程序主题。我正在使用自定义颜色属性,充气机无法识别它,因为它不指向任何地方

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-19
    • 1970-01-01
    • 2018-10-08
    • 1970-01-01
    • 1970-01-01
    • 2018-07-02
    • 2020-10-19
    • 2016-04-03
    相关资源
    最近更新 更多