android - 如何修复此构建错误 > execurnal.tasks 时发生故障 > Android 资源链接失败
问题描述
我得到的其他错误是 AAPT: error: resource android:attr/dialogCornerRadius not found.
, AAPT: error: resource android:attr/fontVariationSettings not found.
,AAPT: error: resource android:attr/ttcIndex not found.
任何帮助,将不胜感激。
这是我的build.gradle
。
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.android.tools.build:gradle:4.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我在 edtail 关注了颤振标志配置。我认为这一定是gradle错误。
这是我的gradle.properties
org.gradle.jvmargs=-Xmx4608m
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
编辑继承人是我的app/build.gradle
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
我的 compile sdk 是 29 android { compileSdkVersion 29
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.scanpal.merchant"
minSdkVersion 21
targetSdkVersion 29
multiDexEnabled true
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
登录配置
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-messaging:20.1.4'
implementation 'androidx.multidex:multidex:2.0.0'
}
也可能是androidX兼容性
apply plugin: 'com.google.gms.google-services'
任何帮助,将不胜感激。
解决方案
推荐阅读
- html - 如何使用css将光标添加到父元素并将其应用于子元素?
- excel - 尝试创建数据透视表时出错
- android - 未安装动态功能模块
- c - CGo 将 go 字符串转换为 *C.uchar
- reactjs - 未捕获的类型错误:尝试使用 React MuiAlert 时无法读取未定义的属性“主”
- c# - 如何在具有多个实例的应用程序中使用 IMemoryCache
- java - 自定义 PropertyPlaceholderConfigurer 不解析嵌入的属性值
- php - 我如何从我的类别 mysql 表中制作下拉菜单仅在 parent_id 不为 0 时显示
- electron - 在 Electron Forge 应用程序中升级 Electron
- c# - 在 .NET Core 3 中执行 SqlRaw 参数查询