构建失败,并发生异常(android.support.v4.media.MediaBrowserCompat $ CustomActionCallback)

时间:2019-05-02 16:59:56

标签: android android-r8

在执行以下操作时,android studio出现构建错误:

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.loginprogram"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

    buildTypes {
        release {
            multiDexEnabled false
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    //implementation 'com.google.android.gms:play-services:11.4.0'
    //implementation 'com.google.firebase:firebase-messaging:27.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.android.support:support-v4:27.0.0'
    implementation 'com.facebook.android:facebook-login:[4,5)'
}

apply plugin: 'com.google.gms.google-services'

... C:\ Users \ admin \ AndroidStudioProjects \ login_program \ build \ app \ intermediates \ transforms \ dexBuilder \ debug \ 124.jar在https://developer.android.com/studio/build/dependencies#duplicate_classes了解如何解决此问题。程序类型已经存在:android.support.v4.media.MediaBrowserCompat $ CustomActionCallback

我的app:build.gradle文件:

name: login_program
description: A new Flutter application.
version: 1.0.0+1
environment:
  sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
  flutter:
    sdk: flutter
  http: ^0.12.0
  path_provider: 0.4.1
  image_picker: 0.4.12+1
  image_cropper: ^0.0.4
  url_launcher:  4.1.0+1
  google_maps_flutter: 0.0.1
  firebase_core: 0.2.5+1
  firebase_auth: 0.7.0
  google_sign_in: 3.2.4
  location: ^1.4.1
  shared_preferences: 0.4.3
  flutter_facebook_login:
  cloud_firestore: 0.8.2+3
  firebase_storage: 1.0.4
  firebase_database: 1.0.5
  bloc: ^0.9.5
  flutter_bloc:
dev_dependencies:
  flutter_test:
    sdk: flutter
flutter:
  uses-material-design: true
  assets:
    - images/team_icon.png
    - images/person.jpg
    - images/Header-3.jpg
    - images/background5.jpg
    - images/background4.jpg
    - images/logo10.png
    - images/facebook_logo.png
    - images/google_logo2.png
    - images/silverappbar.jpg
    - images/painting.jpg
    - images/appBar.png
    - images/b_ticet9.jpg
    - images/b_ticet6.jpg

我的pubspec.yaml:

const Login = () => {

    useEffect(() => {
        if (authenticationService.currentUserValue != null) {
            history.push('/home');
        }
    }, [])

    //other code
}

我开始使用comand来迁移androidx,但出现了“项目中未找到用法”的信息。我在构建中找不到重建产品。 任何解决方案 我需要帮助

0 个答案:

没有答案