![](/img/trans.png)
[英]Could not find any version that matches com.google.android.gms:play-services:0.0.+
[英]Could not find any version that matches com.google.android.gms:play-services:[15.0.0, 16.0.0)
我使用firebase和onesignal,但是在打開項目時出現錯誤,我更新了build-tools,sdk工具和google play服務。
錯誤:無法解決“:app @ debug / compileClasspath”的依賴項:找不到與com.google.android.gms:play-services:[15.0.0,16.0.0)匹配的任何版本。 打開文件
顯示詳細資料錯誤:無法解決“:app @ release / compileClasspath”的依賴項:找不到與com.google.android.gms:play-services:[15.0.0,16.0.0)匹配的任何版本。 打開文件
顯示詳細資料
的build.gradle(項目)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url 'https://dl.bintray.com/drummer-aidan/maven'
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
build.gradle(app):
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "ir.tethys.app"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [
onesignal_app_id : '811bb48c-2350-455d-aa7d-63eea30e226e',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: '845923319180'
]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
buildToolsVersion '28.0.2'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.nabinbhandari.android:permissions:3.5'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.afollestad:easyvideoplayer:0.3.0'
implementation 'com.zarinpal:purchase:0.0.3-beta'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
implementation project(':infinitescrollprovider')
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.android.gms:play-services:12.0.1'
}
apply plugin: 'com.google.gms.google-services'
嘗試將maven { url "https://maven.google.com" }
到您的根目錄build.gradle
文件中,如下所示:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
如果您的Gradle插件版本支持,您也可以這樣做:
allprojects {
repositories {
google()
jcenter()
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.