我正在开发一个 React Native 应用程序。我的 Android 构建开始在CI环境(和本地)中失败,没有任何更改。
Execution failed for task ':app:processDevelopmentDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
.../app/build/intermediates/incremental/mergeDevelopmentDebugResources/merged.dir/values/values.xml:2682: AAPT: error: resource android:attr/lStar not found.
Run Code Online (Sandbox Code Playgroud)
根据Android:即使没有任何更改,资源链接在测试执行时也会失败,这是因为某些库升级了。
lStar需要compileSdkVersion 31而我的项目使用compileSdkVersion 28。
如何跟踪最近更新了哪些库,或者哪个库导致了这种情况?
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> More than one file was found with OS independent path 'lib/armeabi-v7a/libfbjni.so'. If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake
Run Code Online (Sandbox Code Playgroud)
在 app/build.gradle 文件中
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
Run Code Online (Sandbox Code Playgroud)
仍然报错....
尝试过
In app/build.gradle file
packagingOptions {
pickFirst 'lib/x86/libfbjni.so'
pickFirst 'lib/x86_64/libfbjni.so'
pickFirst 'lib/arm64-v8a/libfbjni.so'
pickFirst 'lib/armeabi-v7a/libfbjni.so'
}
Run Code Online (Sandbox Code Playgroud)
但它给出以下错误
More than one file was found with OS independent path …Run Code Online (Sandbox Code Playgroud) 尝试在模拟器中构建我的应用程序后出现这样的错误
/Users/joel/.gradle/caches/transforms-3/06231cc1265260b25a06bafce7a4176f/transformed/core-1.7.0-alpha02/res/values/values.xml:105:5-114:25:AAPT:错误:资源android:attr /lStar 未找到。
我不知道是什么原因导致这个错误。在挖掘了一些具有类似错误(但在颤振中)的答案之后答案之后。但还是没有解决我的问题。
我的项目中有这种依赖性
buildscript {
repositories {
google()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.firebase.crashlytics'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
maven { url "https://teads.jfrog.io/artifactory/SDKAndroid-maven-prod"}
mavenCentral()
}
android {
compileSdkVersion 29
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "mobile.apps.my"
minSdkVersion 17
targetSdkVersion 29
multiDexEnabled true
versionCode …Run Code Online (Sandbox Code Playgroud)