Flutter-geolocator: فشل: فشل البناء مع استثناء.

تم إنشاؤها على ٩ ديسمبر ٢٠٢٠  ·  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]: الروبوت: 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 وتتطلب الآن الإصدار 2.2.0 من مكتبة androidx.lifecycle:lifecycle-runtime بينما لا يستطيع محدد الموقع الجغرافي سوى توفير الإصدار 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. تغيير distributionUrl في ./android/gradle/wrapper/gradle-wrapper.properties إلى distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات

القضايا ذات الصلة

estevez-dev picture estevez-dev  ·  6تعليقات

BigWillieStyle picture BigWillieStyle  ·  6تعليقات

jaumard picture jaumard  ·  3تعليقات

DineshKachhot picture DineshKachhot  ·  7تعليقات

hectorAguero picture hectorAguero  ·  5تعليقات