gpt4 book ai didi

android - java.util.concurrent.ExecutionException : com. android.builder.internal.aapt.v2.Aapt2Exception:Android资源链接失败

转载 作者:行者123 更新时间:2023-12-02 21:11:57 24 4
gpt4 key购买 nike

我制作了一个演示应用程序,并使用 Lottie 添加了一些动画,它在调试中工作正常,但在 Release模式下失败。这是我得到的错误

Execution failed for task ':lottie-react- 
native:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: com.andr

这是我的 build.gradle

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}


allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

ext.versions = [:]
versions.compileSdk = 28
versions.minSdk = 19
versions.targetSdk = 26
versions.support = "28.0.0"
versions.constraint_layout = "1.1.3"
versions.glide = "4.8.0"
versions.work = "1.0.0-alpha10"

应用级分级

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.pois"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
subprojects {
project.configurations.all {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
}
}
}
}
}

signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}




dependencies {
compile project(':lottie-react-native')
compile project(':react-native-code-push')
compile project(':react-native-vector-icons')
compile project(':react-native-view-overflow')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:28.0.0'
compile "com.android.support:support-v4:28.0.+"
compile 'com.facebook.react:react-native:+'
// From node_modules
implementation "android.arch.work:work-runtime:$versions.work"
implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex:rxandroid:1.2.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
transitive = true;
}
}

这个错误是在我将Lottie添加到项目后才出现的。当我使用react-native run-android运行它时它工作正常,但是当我生成签名的apk时它不起作用。

最佳答案

我真是太蠢了。我只需要在各自的 gradle 文件中升级 Lottie 库和 codePush 的compileSdkVersion,瞧,一切顺利。

关于android - java.util.concurrent.ExecutionException : com. android.builder.internal.aapt.v2.Aapt2Exception:Android资源链接失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53585667/

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