我尝试使用 Gradle 及其 gradlew.bat 文件编译一个库,但始终失败。 它显示以下消息:
FAILURE: Build failed with an exception.
block 引用>
What went wrong: A problem occurred configuring project ':library'.
Could not resolve all dependencies for configuration ':library:_debugCompile'.
Could not find com.google.android.gms:play-services:3.1.36. Required by: com.google.maps.android:library:0.3-SNAPSHOT
我已经修改了 gradle 文件以将其指向正确的方向:
List myDependencies = ["com.google.android.gms:play-services:3.1.36", fileTree (dir: 'c://Program Files/Android/sdk/extras/google/m2repository/com/google/android/gms/play-services/3.1.36/', includes: ['*.jar'])] dependencies { compile myDependencies }
我已经安装了 Google 存储库和 Google 支持存储库。
我使用 IntelliJ IDEA。
我还应该尝试什么?
最佳答案
我将 google-play-services.jar 文件复制到我的项目中,并将 build.gradle 文件更改为:
dependencies {
compile files('google-play-services.jar')
}
现在可以正常工作了。
关于android - Google Play 服务无法使用 Gradle 进行编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21392243/