gpt4 book ai didi

android - 构建项目时 Android Studio 出现 AAPT 错误

转载 作者:行者123 更新时间:2023-11-29 02:23:06 26 4
gpt4 key购买 nike

我在构建我的 android 项目时遇到了这个错误。我之前没有收到此错误,但最近我更新了我的 gradle 版本以支持即时应用程序。我想知道这是否是导致问题的原因。

Execution failed for task ':vuclip:processProdAutoFeatureResources'. AAPT2 aapt2-3.2.1-4818971-osx Daemon #0: Unexpected error during link, attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.

编辑:代码编译正常,但在使用命令 ./gradlew clean build 构建 apk 时,构建失败并出现上述异常。

构建.gradle

apply plugin: 'com.android.feature'

android {
compileSdkVersion buildVersion.targetSdk

defaultConfig {
baseFeature true
minSdkVersion buildVersion.minSdk
targetSdkVersion buildVersion.targetSdk
multiDexEnabled = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {

release {
debuggable false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false
abortOnError false
}
}

debug {
debuggable true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
versionNameSuffix "-debug"
}

e2e {
initWith debug
debuggable true
minifyEnabled false
versionNameSuffix "-e2e"
}
auto {
initWith release
debuggable true
versionNameSuffix "-auto"
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
application project(':viuapp')
feature project(':discover')
api "com.android.support:appcompat-v7:$versions.supportLibrary"
api "com.android.support:design:$versions.supportLibrary"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
api project(':boot')
api project(':utilities')
api project(':analytics')
api project(':viu-logger')
api project(':fonts')
api project(':viu-constants')
api project(':app_context')
api project(':storage')
api project(':datamodels')
}
repositories {
mavenCentral()
}

最佳答案

我终于能够修复它。问题是我将一个模块作为库,但没有将其添加到我的基本模块中。您的所有功能模块必须作为依赖项添加到您的播放模块中。

关于android - 构建项目时 Android Studio 出现 AAPT 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53986028/

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