颤抖地将geolocator添加到项目中导致错误 [英] flutter adding geolocator to project giving errors

查看:222
本文介绍了颤抖地将geolocator添加到项目中导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用geolocator获取用户位置.但是,在安装依赖项并运行它之后.我有很多错误.当我删除它并重新运行时,所有错误都消失了.我尝试了该插件的多个版本,但仍然存在相同的错误.这是我的日志输出:

I'm trying to use geolocator to get users location. However after installing dependencies and running it. I get a ton of errors. When I remove it and rerun, all errors are gone. I've tried multiple versions of the plugin and still same error. Here's my log output:

WARNING: This version of firebase_core will break your Android build if it or its dependencies aren't compatible with AndroidX.
         See "url" for more information on the problem and how to fix it.
         This warning prints for all Android build failures. The real root cause of the error may be unrelated.
         *********************************************************

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:905: error: resource android:attr/fontVariationSettings not found.
  C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:905: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

  Command: C:\Users\Mike\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\4564870280758e11a31e0f822b4b55cc\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\Mike\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\Mike\Documents\HikeLocator\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.hikelocator.hikelocator\
          -0\
          apk\
          --output-text-symbols\
          C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
  Output:  C:\Users\Mike\.gradle\caches\transforms-1\files-1.1\appcompat-1.0.1.aar\ff2bf124a1c2911ea68cc7f1f5d69383\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

  C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

  C:\Users\Mike\.gradle\caches\transforms-1\files-1.1\core-1.0.1.aar\b0d75b3838389273bb7c4663ccc599be\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

  C:\Users\Mike\.gradle\caches\transforms-1\files-1.1\core-1.0.1.aar\b0d75b3838389273bb7c4663ccc599be\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.
  Command: C:\Users\Mike\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\4564870280758e11a31e0f822b4b55cc\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\Mike\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\Mike\Documents\HikeLocator\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.hikelocator.hikelocator\
          -0\
          apk\
          --output-text-symbols\
          C:\Users\Mike\Documents\HikeLocator\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s
Finished with error: Gradle task assembleDebug failed with exit code 1

我什至注释掉了firebase_core,以为它可能与geolocator冲突,但是我仍然遇到相同的错误.这是我的依赖项:

I even commented out the firebase_core one thinking it might be conflicting with geolocator, but I'm still getting the same error. Here are my dependencies:

dependencies:
  google_maps_flutter: ^0.0.3+3
  geolocator: ^3.0.0
  http: ^0.12.0
  flutter:
    sdk: flutter
  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.

  cupertino_icons: ^0.1.2
  firebase_auth: ^0.5.8
  #firebase_core: ^0.3.0+2
  firebase_database: ^2.0.1+1

有什么想法吗?谢谢

推荐答案

您依赖的某些库支持AndroidX,而其他库则不支持.对于无AndroidX的解决方案

It's that some of the libraries you depend on supports AndroidX while the others don't. For AndroidX -less solution

尝试更换:

geolocator: ^3.0.0

具有:

geolocator: ^2.1.1
permission_handler: "2.1.2"
google_api_availability: "1.0.4"

更多信息此处此处.

这篇关于颤抖地将geolocator添加到项目中导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆