我的代码在添加Cloud Firestore插件之前运行良好,但在添加此插件之后却出现此错误
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "D:\Flutter\myfarmer\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Flutter\myfarmer\android\app\build.gradle' line: 24
* What went wrong:
A problem occurred evaluating project ':app'.
> ASCII
* Try:
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.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
Command: D:\Flutter\myfarmer\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.```
请确保您使用的是Google的旧版Google服务4.2.0
在android / build.gradle中
dependencies {
...
classpath 'com.google.gms:google-services:4.2.0'
...
}
在我看来是可行的,通过更改类路径来更新flutter或使用gradle的其他版本
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
希望对您有帮助