【发布时间】: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