【问题标题】:Error while building an flutter apk with vscode [duplicate]使用 vscode 构建颤振 apk 时出错 [重复]
【发布时间】:2021-07-12 18:11:51
【问题描述】:

嘿,我是 Flutter 的新用户,我想在没有 Android Studio 的情况下使用 vs 代码创建一个带有 Flutter 的 Android 应用,这可能吗?

我已经安装了android-sdkopenjdk-11-jdk 和 我在运行flutter build apk时遇到一些错误

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Checking the license for package Android SDK Build-Tools 29.0.2 in /usr/lib/android-sdk/licenses
Warning: License for package Android SDK Build-Tools 29.0.2 not accepted.
Checking the license for package Android SDK Platform 30 in /usr/lib/android-sdk/licenses
Warning: License for package Android SDK Platform 30 not accepted.      
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-30 Android SDK Platform 30                       
     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: /usr/lib/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 1s                                                      
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                    1,931ms
Gradle task assembleRelease failed with exit code 1

所以有人帮我解决这个问题?

【问题讨论】:

标签: android flutter dart visual-studio-code


【解决方案1】:

运行flutter doctor --android-licenses 并接受所有

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-25
    • 2020-12-18
    • 1970-01-01
    • 2022-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多