android - 找不到类 'android.view.autofill.AutofillManager

标签 android react-native

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

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

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

关于android - 找不到类 'android.view.autofill.AutofillManager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52315552/

相关文章:

javascript - 在 React 中使用泛型键入 defaultProp 箭头函数方法

node.js - react native 转换错误

reactjs - 如何在没有Expo的情况下安装react-native-svg-transformer?

android - Proguard 与 Autovalue

android - 如何在 ftrace 中设置 trace_pipe 的缓冲区大小?

android - Appcelerator 5.1.2 GA ( iOS, Android ) 的 Paypal 模块

java - Android:不同按钮的相同 Activity ,但操作不同

android - 如何在我们的android应用程序中使用google授权服务?

android - 添加产品口味以响应本地android项目

ios - react native 错误 : EMFILE: too many open files, watch