错误:包com.google.android.gms.location不存在

问题描述

我正在使用Flutter基于用户位置构建应用程序,每当我尝试添加位置Flutter包或geolocator时,我都会遇到此错误并构建失败,错误提示:.pub-cache \ hosted \ pub.dartlang .org \ location-3.0.2 \ android \ src \ main \ java \ com \ lyokone \ location \ FlutterLocation.java:22:错误:包com.google.android.gms.location不存在,请参考位置包相同的错误消息提示:失败:构建失败,出现异常。

  • 出了什么问题: 任务':location:compileDebugJavaWithJavac'的执行失败。 , 我已经根据以前的答案尝试了很多事情,但是没有什么能像编辑buil.gradle一样起作用 这就是我的应用构建gradle的样子

    应用插件:“ com.android.application” 应用插件:“ com.google.gms.google-services” 应用插件:“ kotlin-android” 适用于:“ $ FlutterRoot / packages / Flutter_tools / gradle / Flutter.gradle”

    android { compileSdkVersion 28

      sourceSets {
          main.java.srcDirs += 'src/main/kotlin'
      }
    
      lintOptions {
          disable 'InvalidPackage'
      }
    
      defaultConfig {
          // Todo: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId "com.example.foodApp"
          minSdkVersion 21
          targetSdkVersion 28
          versionCode FlutterVersionCode.toInteger()
          versionName FlutterVersionName
          multiDexEnabled true
      }
    
      buildTypes {
          release {
              // Todo: Add your own signing config for the release build.
              // Signing with the debug keys for Now,so `Flutter run --release` works.
              signingConfig signingConfigs.debug
          }
      }
    

    }

    颤抖{ 资源 '../..' }

    依赖项{ 实现“ org.jetbrains.kotlin:kotlin-stdlib-jdk7:$ kotlin_version” 实施'com.google.firebase:firebase-analytics:17.2.2' 实施'com.google.firebase:firebase-auth:19.3.2' }

知道什么地方错了吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)