在我的项目中,我使用Firebase分析。在我从
中更新了gradle的版本之后implementation 'com.google.firebase:firebase-core:16.0.7'
到
implementation 'com.google.firebase:firebase-core:17.0.0'
我遇到编译错误
Android resource linking failed
/Users/josefvancura/Desktop/Programing/Android/PepaApps/Dochazka/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2663: error: resource android:attr/fontVariationSettings not found.
/Users/josefvancura/Desktop/Programing/Android/PepaApps/Dochazka/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:2663: error: resource android:attr/ttcIndex not found.
error: failed linking references.
我的build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.27.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 27 // Android 8.1.
defaultConfig {
applicationId "cz.vancura.dochazka"
minSdkVersion 21 // Android 5.0
targetSdkVersion 27 // android 8.1
versionCode 11 // vzdy plus 1
versionName "5.5"
}
signingConfigs {
buildTypes {
debug {
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + System.currentTimeMillis() + "L)"
}
release {
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + System.currentTimeMillis() + "L)"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:preference-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:cardview-v7:27.1.1'
// update to version 17 - compile error, keep 16.0.7
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation('com.crashlytics.sdk.android:crashlytics-ndk:2.0.3@aar') {
transitive = true
}
implementation 'com.github.hotchemi:android-rate:1.0.1'
implementation 'com.opencsv:opencsv:4.0'
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'
crashlytics {
enableNdk true
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
}
答案 0 :(得分:0)
尝试将compileSdkVersion更改为:compileSdkVersion 28
答案 1 :(得分:0)
您可以检查official release notes:
警告:此版本是主要版本更新和重大更改。 Google Play服务和Firebase的最新更新包括以下更改:
从Android支持库迁移到Jetpack(AndroidX)库。除非您在应用中进行以下更改,否则图书馆将无法工作:
com.android.tools.build:gradle
升级到v3.2.1或更高版本。compileSdkVersion
升级到28或更高版本。 您必须将compileSdkVersion
更改为28并迁移到androidx库。
compileSdkVersion 28
您还可以检查fontVariationSettings
属性。
它是在api级别28中添加的。