firebase - Flutter 运行返回:评估项目 ':app' 时出现问题。" ">ASCII"
问题描述
我正在尝试遵循“将 firebase 添加到颤振”教程(https://firebase.google.com/docs/flutter/setup)。我已经用许多以前的版本做到了这一点。
现在在 Flutter 1.9 上,我收到“评估项目 ':app' 时出现问题”。">ASCII"。这是一个已知的问题?
颤振医生:
PS C:\DEV\auth> flutter doctor -v
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 31.3.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[√] VS Code, 64-bit edition (version 1.39.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.5.1
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
构建.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.3.2' // Google Services plugin
}
}
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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 28
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.auth"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
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'
解决方案
可悲的是,这似乎是各种各样的事情。
尝试上面写的版本碰撞,但对我来说实际上需要添加
minifyEnabled true,特别是在 app/build.gradle 添加
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
signingConfig signingConfigs.release
**minifyEnabled true**
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
推荐阅读
- flutter - 带参数的单例注入
- java - ArrayList 添加的项目被 for 循环中的下一个项目替换
- python - 如何在 Python 中生成 JSON 格式的 Kafka 消息
- python - 无法将字符串转换为浮点数:'10,000' 使用 Django
- javascript - NodeJS 异步连接到 Mongo DB
- perforce - 是什么导致此错误消息 [错误]:“客户端‘主机’未知 - 使用‘客户端’命令创建它。”?
- python - Numpy 计算 3D 矩阵内部数组的点积
- iot - Azure 逻辑应用:从 IoT 中心消息中读取遥测数据作为动态内容
- java - Flink:包装可执行的非 flink jar 以在 flink 集群中运行
- python - 健壮的连续 TCP 连接(python 套接字)