大约2个月前,我部署了一个React Native应用程序的工作版本。最近,我在使用的当前版本遇到了一个问题,该问题不允许我在未收到
的情况下进行构建AAPT:错误:未找到资源android:attr / dialogCornerRadius
AAPT:错误:找不到资源android:attr / fontVariationSettings。
AAPT:错误:找不到资源android:attr / ttcIndex。
错误:链接引用失败。
命令: /Users/someguy/.gradle/caches/transforms-1/files-1.1/aapt2-3.5.0-alpha03-5252756-osx.jar/d3ea99fc2d1356bcc9bc022a544dfd8b/aapt2-3.5.0-alpha03-5252756-osx/aapt2 链接-I \ /Users/someguy/Library/Android/sdk/platforms/android-26/android.jar \ - 表现\ /Users/someguy/projects/third/some-app/android/app/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml \ -o \ /Users/someguy/projects/third/some-app/android/app/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_ \ -R \ @ / Users / someguy / projects / third / some-app / android / app / build / intermediates / incremental / processDebugResources / resources-list-for-resources-debug.ap_.txt \ --auto-add-overlay \ --java \ / Users / someguy / projects / third / some-app / android / app / build /生成/ not_namespaced_r_class_sources / debug / processDebugResources / r \ --proguard-main-dex \ /Users/someguy/projects/third/some-app/android/app/build/intermediates/legacy_multidex_aapt_derived_proguard_rules/debug/processDebugResources/manifest_keep.txt \ --custom-package \ com.someapp \ -0 \ apk \ --output-text-symbols \ /Users/someguy/projects/third/some-app/android/app/build/intermediates/symbols/debug/R.txt \ --no-version-vectors守护程序:AAPT2 aapt2-3.5.0-alpha03-5252756-osx守护程序#0
我无法解决此问题,因此我决定返回并尝试在物理设备上构建以前发布的版本。当我尝试构建该版本时,我收到了相同的确切错误消息!?!?!
我认为问题在于build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.Someapp"
minSdkVersion 19
targetSdkVersion 26
multiDexEnabled true
versionCode 34
versionName "1.3.4"
ndk {
abiFilters "armeabi-v7a", "x86"
}
packagingOptions {
exclude "lib/arm64-v8a/libgnustl_shared.so"
}
externalNativeBuild {
cmake {
arguments '-DANDROID_STL=c++_static'
}
}
}
signingConfigs {
release {
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
}
debug {
debuggable true
}
}
// 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
}
}
}
externalNativeBuild {
cmake {
path 'CMakeLists.txt'
}
}
dexOptions {
jumboMode true
}
}
dependencies {
implementation project(':react-native-i18n')
implementation project(':react-native-svg')
implementation project(':react-native-extra-dimensions-android')
implementation project(':react-native-google-analytics-bridge')
implementation project(':react-native-splash-screen')
implementation project(':react-native-image-picker')
implementation project(':react-native-spinkit')
implementation project(':react-native-fbsdk')
implementation project(':react-native-picker')
implementation 'cn.aigestudio.wheelpicker:WheelPicker:1.1.2'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.facebook.react:react-native:+'
// From node_modules
implementation 'com.facebook.fresco:fresco:1.3.0'
implementation 'com.facebook.fresco:animated-gif:1.3.0'
implementation project(':blelibrary')
implementation project(':gaialibrary')
implementation project(':vmupgradelibrary')
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation project(':react-native-connectivity-status')
implementation("com.google.android.gms:play-services-basement:15.0.1")
implementation("com.google.android.gms:play-services-base:15.0.1")
implementation 'com.android.support:multidex:1.0.3'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
repositories {
}
buildscript {
repositories {
maven { url 'https://github.com/500px/500px-android-blur/raw/master/releases/' }
}
dependencies {
}
}
// apply plugin: 'com.google.gms.google-services'
我能够使用该应用程序的新版本,但是只有在我将其迁移/更新到CompiledSdkVersion至28之后,这才出现了它自己的一系列问题:我无法再使调试器正常工作。另外,我希望保留较旧版本的应用程序。
这使我相信该问题与本机代码无关,而是我在不知不觉中对系统进行的更改。
该应用程序的iOS版本可以正常构建,因此严格来说这是一个Android版本问题。