gpt4 book ai didi

android - Flutter项目建置失败,并显示错误讯息:-

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

Build file 'C:\Users\amani\Desktop\expenseapp\android\build.gradle' line: 24

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Failed to find target with hash string 'android-28' in: C:\Users\amani\AppData\Local\Android\Sdk

* 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.

Launching lib\main.dart on ALE L21 in debug mode...

FAILURE: Build failed with an exception.

* Where:
* Get more help at https://help.gradle.org

BUILD FAILED in 2s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

而android \ build.gradle如下:
buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.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
}

谁能帮我解决这个问题?我已经尝试了许多其他在线解决方案,但是似乎没有任何效果,因此我不知道该怎么做。

运行flutter doctor命令将返回以下内容:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18363.592], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.41.1)
[√] Connected device (1 available)

• No issues found!

最佳答案

在您的android/app/build.gradle文件中,将compileSdkVersion从28更改为29,并将targetSdkVersion 28 更改为 29

然后,再次重建项目。

关于android - Flutter项目建置失败,并显示错误讯息:-,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59963772/

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