【问题标题】:React Native - Could not resolve com.android.support:support-compat:26.1.0React Native - 无法解析 com.android.support:support-compat:26.1.0
【发布时间】:2019-04-13 11:20:22
【问题描述】:

我正在尝试构建我的 React Native 项目

react-native run-android

我收到这个错误

Could not resolve com.android.support:support-compat:26.1.0.
....
 Required by: project :react-native-maps
...
 Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.

但是,我的build.gradle 文件有

implementation "com.android.support:appcompat-v7:28.0.0"

而 builTools 28.0.3 存在于我的 ~/Library/Android/sdk/tools 中,我也尝试过使用两者

implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:appcompat-v7:+"

这对我也不起作用。

【问题讨论】:

  • 检查您的 /node_modules/react-native-maps 文件夹。这个包使用support-compat:26.1.0。也许其配置中的某些版本更改可以解决您的问题
  • 我听到了,但我不明白。 /node_modules/react-native-maps 中是否有我应该更改的特定文件

标签: android react-native


【解决方案1】:

我已经通过升级到最新版本的 react-native-maps 插件解决了这个问题。

npm install --save "react-native-maps@react-native-community/react-native-maps#master"

我认为确保所有插件都得到更新非常重要,特别是如果你有一段时间没有接触你的项目并且当你做的一切都中断了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-10-17
    • 1970-01-01
    • 2023-03-11
    • 1970-01-01
    • 1970-01-01
    • 2020-03-08
    • 2018-08-15
    相关资源
    最近更新 更多