react native gradle报错问题

狄新翰
2023-12-01

前几天开发RN,gradle的jcenter里面报了个兼容性问题。

What went wrong: 
A problem occurred configuring root project ‘gst’. 
Could not resolve all dependencies for configuration ‘:classpath’. 
Could not resolve com.android.tools.build:gradle:3.0.0. 
Could not resolve com.android.tools.build:gradle:3.0.0. 
Could not get resource ‘https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom‘. 

 

我的项目里面加入了  react-native-imei,react-native-vector-icon 还有react-native-orientation

后来解决了,是react-native-orientation导致的,里面gradle不兼容我的项目里面gradle,根据AS左下角提示  Fix 一下就好了。

不过真心觉得java恶心。每个版本一定程度都会存在兼容性问题。

 类似资料: