我是應用程式開發的新手并開始學習Flutter。但是當我嘗試在Nexux 6虛擬電話中運行默認的虛擬腳本時,它給了我錯誤并退出!這是代碼:
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```
uj5u.com熱心網友回復:
打開 SDK 管理器:

然后選擇Android Sdk Command-line Tools
注意:如果它已經被選中那么
- 取消選中
- 申請
- 重新檢查
- 申請

或者在適用于 Windows 的 Android Studio 中:
去File-> Settings-> Appearance & Behaviour-> System Settings-> Android SDK-> SDK Tools-> check Google Play Licensing Library-> check Android SDK Platform-Tools-> check Android SDK Command-line-Tools(latest)-> Click Apply,然后Ok
安裝后,構建您的應用程式。它應該作業。檢查flutter doctor從命令列運行的狀態
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/396115.html
上一篇:在依賴項的AAR元資料中指定的minCompileSdk(31)-此錯誤多次顯示,我是android新手,我應該如何解決這個問題
