android - 颤振:AAPT2 aapt2-3.5.0-5435860-windows 守护进程 #2:意外的标准输出:就绪
问题描述
该应用程序在我将其连接到 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'...
构建.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
}
-
构建.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 get upgrade错误是在添加到firebase之后出现的
解决方案
脚步 :
尝试添加这一行 在你的项目文件夹 > android > app > build.gradle 中,在 defaultConfig 中添加以下行
multiDexEnabled 真
然后在 android/build.gradle 文件中升级 gradle 依赖:classpath 'com.android.tools.build:gradle:3.3.1'
运行 flutter clean 并重建你的项目
推荐阅读
- reactjs - React - 将变量设置为函数返回不起作用
- python - 预测标签已关闭 - KERAS / Tensorflow
- r - Shiny-R:在ggplot下按组显示回归方程
- python - 如何让 pybtex 将缺少的字段读取为 NULL 而不是跳过记录?
- docker - Docker-compose 扩展选项和相对路径
- python - 为什么即使时间是 18.24 代码也会说早安
- ios - 在 Swift UIKit 中投掷纸/球效果动画
- python - 为什么我的scrapy脚本只抓取第一页而不是其他页面?
- c# - 给定条件打开另一个表单?C#视觉工作室
- python - 在 Django 的 CRUD 中对 OPTIONS 请求做出什么回答?