Ara*_*ink 64 android google-play-services firebase-cloud-messaging
嗨我开始在Android和导入firebase的新项目,如谷歌文档中所述.在Android studio 3.0.1中,一切都很完美.现在我将我的Android工作室更新为3.2.1.现在相同的代码重建并得到错误
找不到com.google.gms:google-services:4.0.1
记录是:
Could not find com.google.gms:google-services:4.0.1.
Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/gms/google-services/4.0.1/google-services-4.0.1.pom
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/gms/google-services/4.0.1/google-services-4.0.1.jar
https://jcenter.bintray.com/com/google/gms/google-services/4.0.1/google-services-4.0.1.pom
https://jcenter.bintray.com/com/google/gms/google-services/4.0.1/google-services-4.0.1.jar
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.0.1/google-services-4.0.1.pom
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.0.1/google-services-4.0.1.jar
Required by:
project :
Run Code Online (Sandbox Code Playgroud)
我的项目级别Gradle是:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
应用级Gradle是:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.arafa.sms"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:animated-vector-drawable:27.1.0'
implementation 'com.android.support:support-media-compat:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'com.squareup.okhttp3:okhttp:3.3.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
这是什么问题!请帮帮我!
Dav*_*rda 60
我有同样的问题,似乎Google repo缺少这种依赖.我检查了存储库,gms文件夹不包含任何已发布的版本.
因此,作为快速修复,我添加了另一个存储库,它有:
repositories {
maven { url 'https://dl.bintray.com/android/android-tools' }
}
Run Code Online (Sandbox Code Playgroud)
编辑:由于这只是一个临时解决方案,我认为它是一种解决方法,所以我能够继续开发.稍后当Google存储库包含依赖项或我们知道它们移动它的位置时,我将删除此依赖性.
| 归档时间: |
|
| 查看次数: |
8066 次 |
| 最近记录: |