Android:gradle 由于无法解析符号,构建停止
Android: gradle build stops due to not being able to resolve the symbols
我目前正在使用 Android Studio,我在文件 -> 项目结构 -> 模块中添加了三个库(com.android.support:support-v4:23.0.1
、com.android.support:appcompat-v7:23.0.1
和 com.android.support:support-v13:23.0.1
)- > 应用程序 -> 依赖项 -> 库依赖项。
另外,我查看了build.gradle文件,好像没有问题。这是 gradle 代码。
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.marshall.thequizshow"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':volley')
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v13:23.0.1'
}
但是,当我尝试 运行 应用程序时,我无法继续前进,因为 gradle 构建消息一直在说 'Error retrieving parent for item' 之类的内容。这是其中一条消息。
/Users/marshall/AndroidStudioProjects/TheQuizShow/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-hdpi/values-hdpi.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Base.Widget.AppCompat.DrawerArrowToggle.Common'.
Error:(6, 23) No resource found that matches the given name: attr 'barLength'.
Error:(8, 23) No resource found that matches the given name: attr 'drawableSize'.
Error:(7, 23) No resource found that matches the given name: attr 'gapBetweenBars'.
我明明把库加到项目里了,但还是不明白为什么一直说不能解析库相关的符号..
我不知怎么找到了这个问题的答案,但我仍然不知道为什么会这样。无论如何,我只是通过清理和重新构建项目来解决这个问题..
我目前正在使用 Android Studio,我在文件 -> 项目结构 -> 模块中添加了三个库(com.android.support:support-v4:23.0.1
、com.android.support:appcompat-v7:23.0.1
和 com.android.support:support-v13:23.0.1
)- > 应用程序 -> 依赖项 -> 库依赖项。
另外,我查看了build.gradle文件,好像没有问题。这是 gradle 代码。
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.marshall.thequizshow"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':volley')
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v13:23.0.1'
}
但是,当我尝试 运行 应用程序时,我无法继续前进,因为 gradle 构建消息一直在说 'Error retrieving parent for item' 之类的内容。这是其中一条消息。
/Users/marshall/AndroidStudioProjects/TheQuizShow/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-hdpi/values-hdpi.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Base.Widget.AppCompat.DrawerArrowToggle.Common'.
Error:(6, 23) No resource found that matches the given name: attr 'barLength'.
Error:(8, 23) No resource found that matches the given name: attr 'drawableSize'.
Error:(7, 23) No resource found that matches the given name: attr 'gapBetweenBars'.
我明明把库加到项目里了,但还是不明白为什么一直说不能解析库相关的符号..
我不知怎么找到了这个问题的答案,但我仍然不知道为什么会这样。无论如何,我只是通过清理和重新构建项目来解决这个问题..