【发布时间】:2018-04-11 22:22:03
【问题描述】:
添加包后,我无法构建项目。错误:
配置项目 ':app' 时出现问题。
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':react-native-google-fit'.
> Could not resolve all dependencies for configuration ':react-native-google-fit:_debugPublishCopy'.
> Could not find com.google.android.gms:play-services-auth:11.6.0.
Searched in the following locations:
file:/Users/wojciech/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-auth/11.6.0/play-services-auth-11.6.0.pom
file:/Users/wojciech/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-auth/11.6.0/play-services-auth-11.6.0.jar
file:/Users/wojciech/Documents/dev/uni/swifty-app/Swifty/android/sdk-manager/com/google/android/gms/play-services-auth/11.6.0/play-services-auth-11.6.0.jar
file:/Users/wojciech/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/11.6.0/play-services-auth-11.6.0.pom
file:/Users/wojciech/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-auth/11.6.0/play-services-auth-11.6.0.jar
file:/Users/wojciech/Documents/dev/uni/swifty-app/Swifty/android/sdk-manager/com/google/android/gms/play-services-auth/11.6.0/play-services-auth-11.6.0.jar
Required by:
Swifty:react-native-google-fit:unspecified
> Could not find com.google.android.gms:play-services-fitness:11.6.0.
Searched in the following locations:
file:/Users/wojciech/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-fitness/11.6.0/play-services-fitness-11.6.0.pom
file:/Users/wojciech/Library/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services-fitness/11.6.0/play-services-fitness-11.6.0.jar
file:/Users/wojciech/Documents/dev/uni/swifty-app/Swifty/android/sdk-manager/com/google/android/gms/play-services-fitness/11.6.0/play-services-fitness-11.6.0.jar
file:/Users/wojciech/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-fitness/11.6.0/play-services-fitness-11.6.0.pom
file:/Users/wojciech/Library/Android/sdk/extras/android/m2repository/com/google/android/gms/play-services-fitness/11.6.0/play-services-fitness-11.6.0.jar
file:/Users/wojciech/Documents/dev/uni/swifty-app/Swifty/android/sdk-manager/com/google/android/gms/play-services-fitness/11.6.0/play-services-fitness-11.6.0.jar
Required by:
Swifty:react-native-google-fit:unspecified
提前致谢。
【问题讨论】:
-
只是因为这是 StackOverflow React Native 问题上非常常见的错误,我不得不问:您是否按照说明完成?这是一个原生模块,所以仅仅添加包是行不通的;您还需要进行链接,对于这个特定的包,还需要一些手动步骤。除此之外,如果您使用
react-react-native-app或Expo,如果不弹出/分离,这将无法工作。