我在更新Gradle(同时也添加了maven{jitpack.io}和geofirestore依赖项)后遇到了这个错误:
Android resource linking failed
Output: C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1169: error: resource android:attr/fontVariationSettings not found.
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:1170: error: resource android:attr/ttcIndex not found.
error: failed linking references.
Command: C:\Users\Paul\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\74062dcec80f00402d5904d26f22db6e\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\
C:\Users\Paul\AppData\Local\Android\Sdk\platforms\android-27\android.jar\
--manifest\
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
-o\
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
-R\
@C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
--auto-add-overlay\
--java\
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
--custom-package\
com.how2ride.how2ride\
-0\
apk\
-c\
en,fr\
--output-text-symbols\
C:\Users\Paul\AndroidStudioProjects\How2Ride2\app\build\intermediates\symbols\debug\R.txt\
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
我该如何解决这个问题?
以下是我的项目Build Gradle文件:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.2'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的Module build gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.how2ride.how2ride"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resConfigs "en", "fr"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-firestore:17.1.0'
implementation 'com.github.imperiumlabs:GeoFirestore-Android:v1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
我拥有最新版本的Android Studio,在升级Gradle之前,我的项目完美运行...
buildToolsVersion
是否大于等于 28.00? - kike