【问题标题】:can´t compiling flutter Geolocator using LInux Mint #882无法使用 LInux Mint #882 编译颤振地理定位器
【发布时间】:2021-12-09 12:50:05
【问题描述】:

我的项目是一个打印经纬度的简单应用

我正在使用: Linux Mint 19.3

类路径'com.android.tools.build:gradle:4.1.3'

compileSdkVersion 31

编译结果如下:


FAILURE:构建失败并出现异常。

What went wrong:
Execution failed for task ':app:processDebugResources'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform play-services-base-17.0.0.aar (com.google.android.gms:play-services-base:17.0.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}.
> Execution failed for AarResourcesCompilerTransform: /home/luis/.gradle/caches/transforms-2/files-2.1/bb3cc3ced1388fcd9c0c925717b75148/jetified-play-services-base-17.0.0.
> AAPT2 aapt2-4.1.3-6503028-linux Daemon #6: Unexpected error during compile '/home/luis/.gradle/caches/transforms-2/files-2.1/bb3cc3ced1388fcd9c0c925717b75148/jetified-play-services-base-17.0.0/res/drawable-xxhdpi-v4/common_google_signin_btn_icon_dark_normal_background.9.png', attempting to stop daemon.

【问题讨论】:

    标签: android linux flutter geolocation linux-mint


    【解决方案1】:

    最后,我想办法在 android/build.gradle 解决这个问题

    将 4.1.0 降级为 3.4.2。为什么?因为我有另一个应用在使用这个版本。

    dependencies {
            //classpath 'com.android.tools.build:gradle:4.1.0'
            classpath 'com.android.tools.build:gradle:3.4.2'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        }
    

    【讨论】:

      【解决方案2】:

      这与您的本地缓存有关。 有两种方法可以解决这个问题。

      1. 尝试 flutter pub 缓存修复
      2. 在 android studio 和 syn Gradle 中打开您的 Project ProjectName/android 项目。并通过 android studio 构建它。

      【讨论】:

      • 我提出了你的建议,结果是一样的。
      • /home/luis/.gradle 删除上述路径中的 .gradle 文件夹。运行 flutter clean ,flutter pub get
      • .gradle 已删除...扑腾干净,得到,再也没有...同样的结果
      【解决方案3】:

      minSDKVersion 怎么样? 尝试: compileSdkVersion 31 minSdkVersion 21 targetSdkVersion 29 和地理定位器:^7.6.0

      【讨论】:

      • 没有任何变化。结果完全一样
      猜你喜欢
      • 1970-01-01
      • 2021-09-15
      • 2023-03-13
      • 2023-03-25
      • 1970-01-01
      • 2021-12-03
      • 1970-01-01
      • 2020-04-19
      • 1970-01-01
      相关资源
      最近更新 更多