【发布时间】:2021-12-28 14:17:02
【问题描述】:
我是应用程序开发的新手,开始学习 Flutter。但是当我尝试在Nexux 6 Virtual Phone 中运行默认的虚拟脚本时,它给了我错误并退出!代码如下:
Running Gradle task 'assembleDebug'...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Checking the license for package Android SDK Build-Tools 29.0.2 in C:\Users\Raghaw Panpaliya\AppData\Local\Android\sdk\licenses
Warning: License for package Android SDK Build-Tools 29.0.2 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not create task ':app:minifyReleaseWithR8'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: C:\Users\Raghaw Panpaliya\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.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1```
【问题讨论】:
-
运行
flutter doctor --android-licenses看看在哪里得到,How to resolve license issues in Flutter 可能会有所帮助 -
我在
CMD和flutter_console中运行了该命令,但我得到了这个结果:找不到 Android sdkmanager。更新到最新的 Android SDK 并确保已安装 cmdline-tools 以解决此问题。
标签: android flutter android-studio