找不到类'android.view.autofill.autofillManager



我的 React-Native 项目停止在这些 Android 版本 [4.2.2、4.3、4.4.2] 上工作,奇怪的是它可以在 4.4.4 上运行,我没有更改本机代码中的任何内容,甚至没有实现任何新功能,即使尝试构建旧的工作版本,它也停止在较新的版本上运行

日志给了我两个错误,找不到任何解决方案:

E/dalvikvm: Could not find class 'android.view.autofill.AutofillManager', referenced from method com.facebook.internal.Utility.isAutofillAvailable
E/com.facebook.internal.AttributionIdentifiers: getAttributionIdentifiers should not be called from the main thread

这是我的build.gradle:

def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "appname"
minSdkVersion 17
targetSdkVersion 27
versionCode 1199
versionName "3.2.5"
vectorDrawables.useSupportLibrary = true
// Enabling multidex support.
multiDexEnabled true
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false  // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// 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
}
}
}
}
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:3.2.1'
}
}

configurations.all {
resolutionStrategy {
force 'org.webkit:android-jsc:r216113'
}
}
dependencies {
implementation project(':appcenter')
implementation project(':appcenter-crashes')
implementation project(':react-native-blur')
implementation project(':react-native-i18n')
implementation project(':react-native-fbsdk')
implementation project(':react-native-sound')
implementation project(':react-native-audio')
implementation project(':react-native-config')
implementation project(':react-native-svg')
implementation project(':react-native-picker')
implementation project(':react-native-sentry')
implementation project(':react-native-restart')
implementation project(':react-native-firebase')
implementation project(':react-native-intercom')
implementation project(':react-native-code-push')
implementation project(':react-native-fetch-blob')
implementation project(':react-native-device-info')
implementation project(':react-native-image-picker')
implementation project(':react-native-open-notification')
implementation project(':react-native-sensors')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-image-crop-picker')
implementation project(':react-native-exception-handler')
implementation project(':react-native-flag-secure-android')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.1.1"
implementation "com.facebook.react:react-native:+"
implementation 'com.android.support:multidex:1.0.3'
implementation 'io.intercom.android:intercom-sdk-base:5.+'
implementation 'io.intercom.android:intercom-sdk-fcm:5.+'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation "com.google.firebase:firebase-auth:16.0.3"
implementation "com.google.firebase:firebase-database:16.0.2"
implementation 'com.google.firebase:firebase-messaging:17.3.1'
implementation "com.google.firebase:firebase-storage:16.0.2"
implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
}
// 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'
}
// Apply Google services's GMS plug-in.
apply plugin: 'com.google.gms.google-services'

有人可以帮忙或指出我解决这个问题所需的方向吗

我找到了解决方案,修改您的android/build.gradle

allprojects {
repositories {
// ...
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.34.0'
}
}
}

原答案在这里:https://stackoverflow.com/a/52148465/1216601

最新更新