react native google places:找不到com.google.android.gms:play services base:11.6.2
我使用本地google places,我遵循文档,它在ios上运行得非常好 另一方面,在android上,我有一个错误:react native google places:找不到com.google.android.gms:play services base:11.6.2,android,react-native,google-api,google-places,Android,React Native,Google Api,Google Places,我使用本地google places,我遵循文档,它在ios上运行得非常好 另一方面,在android上,我有一个错误: Build failed with an exception. What went wrong: A problem occurred configuring project ':app'. > Could not resolve all dependencies for configuration ':app:_debugApk'. > A proble
Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':react-native-google-places'.
> Could not resolve all dependencies for configuration ':react-native-google-places:_debugPublishCopy'.
> Could not find com.google.android.gms:play-services-base:11.6.2.
Searched in the following locations:
file:/Users/Manu/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-base/11.6.2/play-services-base-11.6.2.pom
file:/Users/Manu/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-base/11.6.2/play-services-base-11.6.2.jar
file:/Users/Manu/Desktop/AwesomeProject/android/sdk-manager/com/google/android/gms/play-services-base/11.6.2/play-services-base-11.6.2.jar
file:/Users/Manu/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-base/11.6.2/play-services-base-11.6.2.pom
file:/Users/Manu/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-base/11.6.2/play-services-base-11.6.2.jar
file:/Users/Manu/Desktop/AwesomeProject/android/sdk-manager/com/google/android/gms/play-services-base/11.6.2/play-services-base-11.6.2.jar
Required by:
AwesomeProject:react-native-google-places:unspecified
> Could not find com.google.android.gms:play-services-places:11.6.2.
Searched in the following locations:
file:/Users/Manu/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-places/11.6.2/play-services-places-11.6.2.pom
...
ps:我今天也更新了android studio
有什么想法吗?我也有同样的问题,我的解决方案是将这一行添加到文件android/build.gradle:
maven {
url 'https://maven.google.com'
}
对不起,我的英语不好:(这个问题是由来自google places和软件包的依赖项版本引起的 您可以通过以下步骤解决此问题 1.open/node_modules/react native google places/android/build.gradle 从更新以前的代码
compile "com.google.android.gms:play-services-base:$googlePlayServicesVersion"
compile "com.google.android.gms:play-services-places:$googlePlayServicesVersion"
compile "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
像这样改变
compile "com.google.android.gms:play-services-base:+"
compile "com.google.android.gms:play-services-places:+"
compile "com.google.android.gms:play-services-location:+"
现在使用命令再次构建apk
react-native run-android
它将解决问题。我希望它对其他一些成员有用。谢谢。你确定你的android/build.gradle是这样的:如果它不工作,你可以用git克隆我的回购:希望它对你有用