Flutter-geolocator: 失敗:ビルドは例外で失敗しました。

作成日 2020年12月09日  ·  4コメント  ·  ソース: Baseflow/flutter-geolocator

🐛バグレポート

Flutterを最新バージョンに更新し、Geolocatorをバージョン^6.1.13に更新した後、アプリケーションはAndroid用にビルドを停止しました。 IOSには問題はありません。

デバッグコンソール

FAILURE: Build failed with an exception.

* What went wrong:
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'

   > Could not resolve androidx.lifecycle:lifecycle-runtime:{strictly 2.0.0}.
     Required by:
         project :geolocator
      > Cannot find a version of 'androidx.lifecycle:lifecycle-runtime' 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-runtime:2.2.0'
           Constraint path 'com.baseflow.geolocator:geolocator:1.0' --> 'androidx.lifecycle:lifecycle-runtime:{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.fragment:fragment:1.1.0' --> 'androidx.activity:activity:1.0.0' --> 'androidx.lifecycle:lifecycle-runtime:2.1.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.core:core:1.1.0' --> 'androidx.lifecycle:lifecycle-runtime:2.0.0'

...

フラッタードクター-v

[✓] Flutter (Channel master, 1.25.0-5.0.pre.125, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-CY)
    • Flutter version 1.25.0-5.0.pre.125 at /Users/Sammius/Flutter/flutter
    • Framework revision a12e2a473a (3 hours ago), 2020-12-08 23:13:04 -0500
    • Engine revision df39e5c515
    • Dart version 2.12.0 (build 2.12.0-133.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/Sammius/android
    • Platform android-29, build-tools 28.0.3
    • ANDROID_HOME = /Users/Sammius/android
    • ANDROID_SDK_ROOT = /Users/Sammius/android
    • Java binary at: /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0.rc.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] IntelliJ IDEA Community Edition (version 2019.2.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 39.0.5
    • Dart plugin version 192.7402

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.17.0

[✓] Connected device (2 available)
    • Android SDK built for x86 64 (mobile) • emulator-5554 • android-x64    • Android 9 (API 28) (emulator)
    • Chrome (web)                          • chrome        • web-javascript • Google Chrome 87.0.4280.88

! Doctor found issues in 1 category.

プラットホーム:

  • []:iphone:iOS
  • [x]:robot:Android
android up for graps

最も参考になるコメント

[✓] Flutter (Channel beta, 1.25.0-8.1.pre, on macOS 11.0.1 20B29 darwin-x64, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.52.0)
[✓] Connected device (2 available)

最新のFlutterベータチャネルのビルドが失敗するようになりました

全てのコメント4件

@Sammiusは、この問題を報告していただきありがとうございます。 io.flutter:flutter_embedding_debugライブラリが更新され、 androidx.lifecycle:lifecycle-runtimeライブラリのバージョン2.2.0が必要になりましたが、ジオロケーターはバージョン2.0.0しか提供できません。

これについて調べます。今のところ、Flutterベータ版または安定したチャネルを使用してアプリをビルドすることをお勧めします。

次のFlutterアップデートの後、問題は解消されました。

[✓] Flutter (Channel beta, 1.25.0-8.1.pre, on macOS 11.0.1 20B29 darwin-x64, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.52.0)
[✓] Connected device (2 available)

最新のFlutterベータチャネルのビルドが失敗するようになりました

これで問題が解決しました。

  1. ./android/build.gradleの依存関係のバージョンをclasspath 'com.android.tools.build:gradle:4.1.0'に変更します
  2. ./android/gradle/wrapper/gradle-wrapper.propertiesdistributionUrl $をdistributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zipに変更します
このページは役に立ちましたか?
0 / 5 - 0 評価