gpt4 book ai didi

android - React-native android 构建失败 : "...AAPT: error: resource android:attr/fontVariationSettings not found."

转载 作者:太空宇宙 更新时间:2023-11-03 13:07:27 25 4
gpt4 key购买 nike

我试图在 react-native 应用程序上构建一个 Android 项目。直到今天早上一切正常。这很奇怪,因为没有更改代码但构建失败。这可能与内部依赖更新有关,但我无法弄清楚。

我试图将 compileSdkVersion 更新为 28,但这会产生更多问题,如果不是完全必要,我想避免它。

android/build.gradle

buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 21
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
googlePlayServicesAuthVersion = "15.0.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

android/app/build.gradle

dependencies {
// this is copied from
implementation('com.onesignal:OneSignal:3.10.8') {
// Exclude com.android.support(Android Support library) as the version range starts at 26.0.0
// This is due to compileSdkVersion defaulting to 23 which cant' be lower than the support library version
// And the fact that the default root project is missing the Google Maven repo required to pull down 26.0.0+
exclude group: 'com.android.support'
// Keeping com.google.android.gms(Google Play services library) as this version range starts at 10.2.1
}
implementation project(':react-native-onesignal')
implementation project(':appcenter')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-reanimated')
implementation project(':react-native-audio-jack')
implementation project(':react-native-firebase')
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
implementation project(':appcenter-crashes')
implementation project(':appcenter-analytics')

implementation project(':react-native-heading')
implementation project(':react-native-billing')
implementation project(':react-native-android-badge')
implementation project(':react-native-sound')
implementation project(':react-native-google-analytics-bridge')
implementation project(':react-native-bluetooth-state')
implementation project(':react-native-code-push')
implementation (project(':@mapbox_react-native-mapbox-gl')){
implementation ('com.squareup.okhttp3:okhttp:3.9.1') {
force = true
}
}
implementation project(':react-native-kontaktio')
implementation project(':realm')
implementation project(':rn-fetch-blob')
implementation project(':react-native-restart')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-keep-awake')
implementation project(':react-native-image-crop-picker')
implementation project(':react-native-i18n')
implementation project(':react-native-fs')
implementation project(':react-native-exception-handler')
implementation project(':react-native-device-info')
implementation (project(':react-native-camera')){
exclude group: "com.android.support"
}
implementation project(':react-native-android-location-services-dialog-box')
implementation project(':lottie-react-native')
implementation project(':react-native-google-signin')
implementation project(':react-native-fbsdk')
implementation project(':react-native-config')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation "com.google.firebase:firebase-invites:16.1.0"
}

我希望 Android 构建能够顺利通过。

最佳答案

这似乎与 Google 发布新版本的 Play 服务有关,因为您不想更新 compileSdkVersion。

试试这个:

implementation(project(":react-native-device-info"),  {
exclude group: "com.google.android.gms"
})
implementation "com.google.android.gms:play-services-gcm:16.0.0"

更多详细信息,您可以引用this

关于android - React-native android 构建失败 : "...AAPT: error: resource android:attr/fontVariationSettings not found.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56684107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com