Flutter 颤振:无法确定任务';的依赖关系:地理定位器:CompiledBugaidl';

Flutter 颤振:无法确定任务';的依赖关系:地理定位器:CompiledBugaidl';,flutter,Flutter,我添加了地理定位器,现在 Could not determine the dependencies of task ':geolocator:compileDebugAidl'. > Could not resolve all task dependencies for configuration ':geolocator:debugCompileClasspath'. > Could not resolve androidx.lifecycle:lifecycle-commo

我添加了
地理定位器
,现在

Could not determine the dependencies of task ':geolocator:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':geolocator:debugCompileClasspath'.
   > Could not resolve androidx.lifecycle:lifecycle-common:{strictly 2.0.0}.
     Required by:
         project :geolocator
      > Cannot find a version of 'androidx.lifecycle:lifecycle-common' that satisfies the version constraints: 
           Dependency path 'com.baseflow.geolocator:geolocator:1.0' --> 'io.flutter:flutter_embedding_debug:1.0.0-df39e5c51517a73e61647286ab21252074512c63' --> 'androidx.lifecycle:lifecycle-common:2.2.0'
           Constraint path 'com.baseflow.geolocator:geolocator:1.0' --> 'androidx.lifecycle:lifecycle-common:{strictly 2.0.0}' because of the following reason: debugRuntimeClasspath uses version 2.0.0
           Dependency path 'com.baseflow.geolocator:geolocator:1.0' --> 'io.flutter:flutter_embedding_debug:1.0.0-df39e5c51517a73e61647286ab21252074512c63' --> 'androidx.lifecycle:lifecycle-common-java8:2.2.0' --> 'androidx.lifecycle:lifecycle-common:2.2.0'
           Dependency path 'com.baseflow.geolocator:geolocator:1.0' --> 'io.flutter:flutter_embedding_debug:1.0.0-df39e5c51517a73e61647286ab21252074512c63' --> 'androidx.lifecycle:lifecycle-runtime:2.2.0' --> 'androidx.lifecycle:lifecycle-common:2.2.0'
           Dependency path 'com.baseflow.geolocator:geolocator:1.0' --> 'io.flutter:flutter_embedding_debug:1.0.0-df39e5c51517a73e61647286ab21252074512c63' --> 'androidx.fragment:fragment:1.1.0' --> 'androidx.activity:activity:1.0.0' --> 'androidx.savedstate:savedstate:1.0.0' --> 'androidx.lifecycle:lifecycle-common:2.0.0'
           Dependency path 'com.baseflow.geolocator:geolocator:1.0' --> 'io.flutter:flutter_embedding_debug:1.0.0-df39e5c51517a73e61647286ab21252074512c63' --> 'androidx.fragment:fragment:1.1.0' --> 'androidx.loader:loader:1.0.0' --> 'androidx.lifecycle:lifecycle-livedata:2.0.0' --> 'androidx.lifecycle:lifecycle-livedata-core:2.0.0' --> 'androidx.lifecycle:lifecycle-common:2.0.0'
这样的错误

android {
    compileSdkVersion 30

    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.helloworld.android"
        minSdkVersion 24
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    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
        }
    }
}

gradle.properties
    org.gradle.jvmargs=-Xmx1536M
    android.useAndroidX=true
    android.enableJetifier=true
    android.enableR8=true
雄激素单

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.helloworld">
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

我如何解决这个问题?地理定位器在iOS上运行完全正常。我打赌我在环境中做错了什么。但是,我不太清楚这是什么

** pubspec
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  get: ^3.22.2
  custom_splash: ^0.0.2
  http: ^0.12.2
  provider: ^4.3.2+2
  google_fonts: ^1.1.1
  flutter_slidable: ^0.5.7
  get_storage: ^1.3.2
  background_fetch: ^0.6.0
  video_player: ^1.0.1
  modal_bottom_sheet: ^1.0.0+1
  socket_io_client: ^0.9.12
  google_sign_in: ^4.5.6
  url_launcher: ^5.7.10
  animations: ^1.1.2
  shared_preferences: ^0.5.12+4
  sign_in_with_apple: ^2.5.4
  connectivity: ^2.0.2
  image_picker: ^0.6.7+14
  google_maps_flutter: ^1.0.6
  package_info: ^0.4.3+2
  share: ^0.6.5+4
  camera: ^0.5.8+17
  sensors: ^0.4.2+6
  battery: ^1.0.7
  splash_screen_view: ^1.0.3
  flutter_facebook_login: ^3.0.0
  fab_circular_menu: ^1.0.0
  liquid_pull_to_refresh: ^2.0.0
  font_awesome_flutter: ^8.10.1
  cached_network_image: ^2.4.1
  geolocator: ^6.1.13
  flutter_plugin_android_lifecycle: ^1.0.11

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.1

dev_dependencies:
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/images/
    - assets/icons/
    - assets/videos/

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  fonts:
    - family: auth_font
      fonts:
        - asset: assets/fonts/auth_font.ttf
        

  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages
**pubspec
https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
版本:1.0.0+1
环境:

sdk:“>=2.7.0因为我已经阅读了完整的错误日志,并且我正在找出问题所在

io.flatter:flatter\u embedding\u debug
库已更新,现在需要
androidx.lifecycle:lifecycle runtime
库的2.2.0版,而地理定位器只能提供2.0.0版

发行
这为我解决了问题:

  • /android/build.gradle
    中的
    com.android.tools.build:gradle
    依赖版本更新为
    classpath'com.android.tools.build:gradle:4.1.0'
  • /android/gradle/wrapper/gradle wrapper.properties中的
    distributionUrl
    更改为
    distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

  • 尝试此命令。$flatter pub cache repair我刚刚尝试过,但没有成功。添加pubspec codeok!这很好。您可以从geolocator中删除^s,然后再次同步吗?您需要迁移到androidX。我升级了,然后谷歌登录,其他软件包被破坏。如果不升级,我如何使用2.0.0?!