gpt4 book ai didi

android - Flutter 返回 `lifecycle-common-java8.jar (androidx.lifecycle:lifecycle-common-java8:2.0.0)` 错误

转载 作者:行者123 更新时间:2023-12-03 03:55:45 25 4
gpt4 key购买 nike

Flutter 项目无法在带有 AndroidX 的 Android Studio 中运行兼容性并在运行/控制台窗口中返回以下错误:

FAILURE: Build failed with an exception.





FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'path_provider'. SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

最佳答案

如果您遇到这些错误,只需执行以下步骤:

  • 在 Android Studio 中打开 Android 项目(您可以在 android 路径中打开文件或类,然后选择 Open for Editing interface Android Studio 如下图所示)

  • enter image description here
  • Build窗口选择错误行然后在右侧选择Affected Modules :

  • enter image description here
  • 对于打开的文件 (build.gradle) 中的每个模块,添加 lifecycle-common-java8 api 内 dependencies{}部分,然后构建项目:
    dependencies {
    ...

    api "androidx.lifecycle:lifecycle-common-java8:2.2.0"

    }

  • enter image description here
  • 最后关闭 Android 项目并运行 Flutter 项目。
  • 关于android - Flutter 返回 `lifecycle-common-java8.jar (androidx.lifecycle:lifecycle-common-java8:2.0.0)` 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60120802/

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