每当添加实现'com.google.firebase:firebase-analytics:17.2.2'和应用插件:'com.google.gms.google-services'时,我都会收到错误消息进入app> build.gradle,以及 classpath'com.google.gms:google-services:4.3.3'进入android> build.gradle。 如果我不使用这三件事,则应用程序运行正常。我想念什么?
这是我遇到的错误
Launching lib\main.dart on Android SDK built for x86 in debug mode...
[!] Your app isn't using AndroidX.
To avoid potential build failures, you can quickly migrate your app by following the steps on.
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\HASAN\Mobile_App_Projects\bangla_jokes\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.
BUILD FAILED in 1s
Finished with error: Gradle task assembleDebug failed with exit code 1
答案 0 :(得分:0)
您需要迁移到androidx。检查这里:
https://flutter.dev/docs/development/androidx-migration
了解如何将应用程序迁移到androidX。
或者,您可以将flutter更新到最新版本,并创建一个将自动使用androidx的新项目。您可以通过执行以下命令进行更新:
<CryptoService>
..
<Secret>SECRET_KEY</Secret>
</CryptoService>