在我的应用程序build.gradle中,我有此设置
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.1'
}
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven {
url 'https://jitpack.io'
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
}
ext {
supportlib_version = '26.0.2'
gps_version = '15.0.2'
}
在我的另一个gradle文件中,我已经集成了这些库
依赖性{
implementation fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.devbrackets.android:exomedia:4.0.3'
//Radio
compile 'com.squareup.okhttp3:okhttp:3.3.1'
//WC
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.onesignal:OneSignal:[3.6.0,4.0.0)'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.booking:rtlviewpager:1.0.1'
compile 'com.github.apg-mobile:android-round-textview:v0.0.3'
compile 'com.github.chrisbanes:PhotoView:1.3.0'
compile 'com.google.code.gson:gson:2.8.0'
//TV & Radio
compile "com.android.support:cardview-v7:$supportlib_version"
compile "com.android.support:appcompat-v7:$supportlib_version"
compile "com.android.support:recyclerview-v7:$supportlib_version"
compile "com.android.support:design:$supportlib_version"
compile "com.android.support:support-v4:$supportlib_version"
compile "com.android.support:support-core-utils:$supportlib_version"
compile "com.android.support:support-media-compat:$supportlib_version"
implementation 'com.google.firebase:firebase-messaging:15.0.2'
compile "com.google.android.gms:play-services-gcm:$gps_version"
compile "com.google.android.gms:play-services-ads:$gps_version"
}
在构建时遇到此错误-无法解决:com.google.android.gms:play-services-gcm:15.0.2 安装存储库并同步项目
当我尝试安装它时,错误提示找不到存储库
请建议我应该使用哪个版本进行正确的构建。
答案 0 :(得分:1)
目前没有15.0.2版本的play-services-gcm(请参阅http://maven.google.com)。
由于这个确切的原因,现在不建议您使用$gps_version
变量;播放服务库将在不同的发行周期迭代不同的版本。请参阅最新指南:https://developers.google.com/android/guides/versioning#remove_old_anti_pattern