Flutter:AAPT2 aapt2-3.5.0-5435860-windows守护程序#2:意外的标准输出:就绪

时间:2020-08-09 16:10:22

标签: android firebase flutter dart

在将应用程序连接到firebase之前,该应用程序已运行且没有错误。在我连接到Firebase之后,出现此错误

它是hello world应用程序(默认示例应用程序)

 AAPT2 aapt2-3.5.0-5435860-windows Daemon #2: Unexpected standard output: Ready
Running Gradle task 'assembleDebug'...
AAPT2 aapt2-3.5.0-5435860-windows Daemon #1: Unexpected standard output: Ready
Running Gradle task 'assembleDebug'...

Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Running Gradle task 'assembleDebug'...

Running Gradle task 'assembleDebug'...
* What went wrong:
Running Gradle task 'assembleDebug'...
Execution failed for task ':app:mergeDebugResources'.
Running Gradle task 'assembleDebug'...
> Multiple task action failures occurred:
Running Gradle task 'assembleDebug'...
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade       
Running Gradle task 'assembleDebug'...
      > AAPT2 aapt2-3.5.0-5435860-windows Daemon #0: Daemon startup failed
Running Gradle task 'assembleDebug'...
        This should not happen under normal circumstances, please file an issue if it does.
Running Gradle task 'assembleDebug'...
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Running Gradle task 'assembleDebug'...
      > AAPT2 aapt2-3.5.0-5435860-windows Daemon #1: Daemon startup failed
Running Gradle task 'assembleDebug'...
        This should not happen under normal circumstances, please file an issue if it does.
Running Gradle task 'assembleDebug'...
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade       
Running Gradle task 'assembleDebug'...
      > AAPT2 aapt2-3.5.0-5435860-windows Daemon #2: Daemon startup failed
Running Gradle task 'assembleDebug'...
        This should not happen under normal circumstances, please file an issue if it does.
Running Gradle task 'assembleDebug'...

Running Gradle task 'assembleDebug'...
* Try:
Running Gradle task 'assembleDebug'...
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Running Gradle task 'assembleDebug'...

Running Gradle task 'assembleDebug'...
* Get more help at https://help.gradle.org
Running Gradle task 'assembleDebug'...

Running Gradle task 'assembleDebug'...
BUILD FAILED in 16m 29s
Running Gradle task 'assembleDebug'...

Running Gradle task 'assembleDebug'... Done                      1030.9s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using      
Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
Exception: The plugin cloud_firestore could not be built due to the issue above.
Running Gradle task 'assembleAarRelease'...      

build.gradle

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

    dependencies {
        
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        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
}


                  -

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.example.mobiboy"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    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 'androidx.multidex:multidex:2.0.1'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

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

我该怎么办才能清除此错误

我尝试了flutter clean,flutter pub得到了升级 错误是在添加到Firebase中之后出现的

1 个答案:

答案 0 :(得分:0)

步骤:

  1. 尝试添加此行在您的Project文件夹> android> app> build.gradle中,在defaultConfig中添加以下行

    multiDexEnabled是

  2. 然后在android / build.gradle文件中升级gradle依赖项:classpath'com.android.tools.build:gradle:3.3.1'

  3. 运行流畅并重建项目