Я использую Firebase в моем приложении флаттера, и эта ошибка мне показалась - PullRequest
0 голосов
/ 05 октября 2019

Я хочу использовать firebase в своем приложении для флаттера, и я следую инструкциям по использованию firebase и получаю эту ошибку.

Launching lib\main.dart on Google Nexus 5X, 8 0, API 26, 1080x1920 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
ERROR: [TAG] Failed to resolve variable '${junit.version}'
ERROR: [TAG] Failed to resolve variable '${animal.sniffer.version}'

FAILURE: сборка не удалась, исключение.

  • Что пошло не так: выполнение задачи не выполнено ': app: processDebugGoogleServices'.

    Не найдено подходящего клиента для имени пакета 'com.technoscans.neolearn'

  • Попробуйте:

Запустите с параметром --stacktrace, чтобы получить трассировку стека. Запустите с параметром --info или --debug, чтобы получить больше вывода журнала. Запустите с параметром --scan, чтобы получить полное представление.

СБОЙ СОСТАВЛЕНИЯ через 2 м 18 с. Завершено с ошибкой: задача Gradle assemblyDebug завершилась неудачно с выходомкод 1

это файл build.gradle

buildscript {
    ext.kotlin_version = '1.2.71'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.2.0'
    }
}

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
}

это файл app / build.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.")
}

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 plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.technoscans.neolearn"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.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 {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

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

1 Ответ

0 голосов
/ 06 октября 2019

Попробуйте очистить Flutter, повторно получить пакеты. а также опубликовать дополнительную информацию, запустив flbter run verbose. У меня всегда были проблемы с версией 4.2, поэтому я использовал classpath 'com.google.gms: google-services: 3.2.0'

...