【问题标题】:I am using VS Code for Flutter. I have downloaded Android SDK platform 30. But it tells me to download 29 version我正在为 Flutter 使用 VS Code。我已经下载了Android SDK平台30。但它告诉我要下载29版本
【发布时间】:2021-05-11 23:26:31
【问题描述】:

我是新来的颤振。以下是 SDK Manager 上可用工具的列表 -

如您所见,我已经下载了这些工具。但是在ide中调试显示错误并告诉我下载了一个没有安装的工具-

'''

  FAILURE: Build failed with an exception.

  * What went wrong:
  Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
   > Failed to install the following SDK components:
      build-tools;28.0.3 Android SDK Build-Tools 28.0.3
      platforms;android-29 Android SDK Platform 29
    Install the missing components using the SDK manager in Android Studio.
   2

   * 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 51s
   [!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
   Exception: Gradle task assembleDebug failed with exit code 1
   Exited (sigterm)

'''

请帮帮我。

【问题讨论】:

  • 不确定,但可能是许可证问题。尝试从命令行运行flutter doctor --android-licenses。输入y,如果不被接受,按回车接受许可。

标签: flutter android-studio dart android-sdk-tools android-sdk-manager


【解决方案1】:

安装某些依赖项(sdk 30)时似乎出现错误。可能是技术故障。尝试使用颤振医生再次安装。

【讨论】:

    【解决方案2】:

    我认为您必须在构建之前接受许可。

    在终端试试这个命令

     flutter doctor --android-licenses
    

    在您的终端中尝试使用颤振医生命令。这有助于我们诊断您的设置问题

    flutter doctor
    

    了解更多https://stackoverflow.com/a/55641042/7904389

    【讨论】:

      【解决方案3】:

      请分享android/app/build.gradle,它可能针对API 级别29(targetSdkVersion 29compileSdkVersion 29)。将它们更改为 30下载 API 级别 29 SDK。

      如果之后仍然无法使用,可能是 SDK 丢失了,请转到 ANDROID_HOME 目录并确保它包含一个 sdk 目录,其中包含您想要的内容。

      【讨论】:

        【解决方案4】:

        我无法弄清楚错误是什么,但创建一个新项目对我有用。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-01-21
          • 1970-01-01
          • 2017-07-25
          • 2020-11-15
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多