代码之家  ›  专栏  ›  技术社区  ›  Tareq El-Masri

找不到类'android.view.autofill自动填充.自动填充管理器

  •  1
  • Tareq El-Masri  · 技术社区  · 6 年前

    日志中有两个错误,无法找到解决方法:

    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
    

    这是我的构建.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'
    

    1 回复  |  直到 6 年前
        1
  •  2
  •   leo7r    6 年前

    我找到了解决办法,修改你的 android/build.gradle

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

    原文如下: https://stackoverflow.com/a/52148465/1216601