gpt4 book ai didi

android-studio - 如何修复导致Flutter应用在启动时失败的异常?

转载 作者:行者123 更新时间:2023-12-03 03:58:05 25 4
gpt4 key购买 nike

我正在尝试实现google admob,以便将广告添加到我的应用程序中,但是当我这样做时,我开始遇到异常。这是我正在得到的当前构建错误

BUILD FAILED in 4s
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 firebase_admob...

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_admob-0.9.0+10\android\build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'firebase_admob'.
> Failed to apply plugin [id 'com.android.library']
> Minimum supported Gradle version is 5.1.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in D:\src\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_admob-0.9.0+10\android\gradle\wrapper\gradle-wrapper.properties to gradle-5.1.1-all.zip

* 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 1s

它说build.gradle文件的第22行,如下所示:
apply plugin: 'com.android.library'

任何建议表示赞赏!谢谢!

最佳答案

您需要将Gradle版本升级到5.1.1

android/gradle/wrapper/gradle-wrapper.properties
更改

distributionUrl=https://services.gradle.org/distributions/gradle-4.10.2-all.zip





distributionUrl=https://services.gradle.org/distributions/gradle-5.1.1-all.zip



android/build.gradle buildscript下->依赖项,更改,

classpath 'com.android.tools.build:gradle:3.3.2'





classpath 'com.android.tools.build:gradle:5.1.1'



然后再试一次。

关于android-studio - 如何修复导致Flutter应用在启动时失败的异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59535762/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com