React Native-无法解析com.android.support:support-compat:26.1.0

时间:2019-04-13 11:20:22

标签: android react-native

我正在尝试构建我的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:+"

这对我也不起作用。

1 个答案:

答案 0 :(得分:0)

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

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

我认为确保所有插件都进行更新非常重要,尤其是如果您有一段时间没有接触过项目并且在做任何事情时都会中断。