Flutter-geolocator: FAILURE: Build gagal dengan pengecualian.

Dibuat pada 9 Des 2020  ·  4Komentar  ·  Sumber: Baseflow/flutter-geolocator

Laporan Bug

Saya secara bersamaan memperbarui Flutter ke versi terbaru dan Geolocator ke versi ^6.1.13 , setelah itu aplikasi berhenti membangun untuk Android. Tidak ada masalah untuk IOS.

Konsol debug

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'

...

dokter berdebar -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.

Platform:

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

Komentar yang paling membantu

[✓] 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)

Sekarang build gagal untuk saluran beta Flutter terbaru

Semua 4 komentar

@Sammius terima kasih telah melaporkan masalah ini. Sepertinya pustaka io.flutter:flutter_embedding_debug telah diperbarui dan sekarang memerlukan versi 2.2.0 dari pustaka androidx.lifecycle:lifecycle-runtime sementara geolocator hanya dapat menyediakan versi 2.0.0.

Saya akan melihat ini, untuk saat ini saya sarankan Anda membangun aplikasi Anda menggunakan Flutter beta atau saluran stabil.

Setelah pembaruan Flutter berikutnya, masalahnya hilang.

[✓] 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)

Sekarang build gagal untuk saluran beta Flutter terbaru

Ini memperbaiki masalah bagi saya:

  1. Ubah versi ketergantungan di ./android/build.gradle menjadi classpath 'com.android.tools.build:gradle:4.1.0'
  2. Ubah distributionUrl di ./android/gradle/wrapper/gradle-wrapper.properties menjadi distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
Apakah halaman ini membantu?
0 / 5 - 0 peringkat