Не удалось выполнить задачу ': app: preDebugBuild'.in Flutter - PullRequest
0 голосов
/ 05 ноября 2018

Зависимость Android 'com.android.support:support-media-compat' имеет разные версии для пути к классам компиляции (26.1.0) и времени выполнения (27.1.1). Вы должны вручную установить ту же версию через DependencyResolution

Я добавил список плагинов в мое приложение флаттера

dependencies:
  flutter:
    sdk: flutter
  connectivity:
  rxdart:
  validate: ^1.7.0
  image_picker: ^0.4.10
  shared_preferences: "^0.4.2"
  firebase_auth: ^0.6.2+1
  google_sign_in:

Версия Dart & Flutter: Dart 2.1.0-dev.3.1.flutter-760a9690c2

Это мое приложение для Android - gradle

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.")
}

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

android {
    compileSdkVersion 27

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.standardappstructure"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // 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 {
    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'
}
apply plugin: 'com.google.gms.google-services'

Версия Gradle распределения:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

Уровень проекта: gradle

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.google.gms:google-services:4.0.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Если я изменяю classpath gradle на

 classpath 'com.android.tools.build:gradle:3.2.1'

Это показывает мне

Зависимость Android 'android.arch.lifecycle: runtime' имеет разные версии для пути к классам compile (1.0.0) и runtime (1.1.0). Вы должны вручную установить ту же версию через DependencyResolution

Ответы [ 2 ]

0 голосов
/ 12 августа 2019
cloud_firestore: ^0.8.2+3
firebase_auth: ^0.6.5
image_picker: 0.4.0

Это работает для меня

0 голосов
/ 23 апреля 2019

Я добавил implementation("com.android.support:support-v4:27.1.1") в build.gradle в моем случае. Надеюсь, это поможет.

...