我添加了地理定位器依赖,然后我得到了一个android x不兼容的错误。有什么能帮我摆脱这个的吗?
Launching lib\main.dart on Android SDK built for x86 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not find androidx.legacy:legacy-support-v4:27.0.2.
Searched in the following locations:
- file:/C:/Users/Rutvik/AppData/Local/Android/sdk/extras/m2repository/androidx/legacy/legacy-support-v4/27.0.2/legacy-support-v4-27.0.2.pom
Required by:
project :app > project :image_picker
* 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 1m 7s
****************************************************发布于 2019-08-19 19:16:00
将所有依赖项迁移到andriodx包将解决此问题。https://developer.android.com/jetpack/androidx/migrate
在这里,您的地理定位器最新使用的是androidx包,其中image_picker依赖使用android包。您需要将image_picker库更新到最新的https://pub.dev/packages/image_picker#-changelog-tab-
或
快速修复:将geo-locator降级到2.1.1以解决此问题。这不是一个最好的方法。
将所有依赖项升级到androidx compatable是您可以尝试的最佳方法。
https://stackoverflow.com/questions/57554665
复制相似问题