找不到com.google.gms:google-services:4.1.0.在以下位置搜索: [英] Could not find com.google.gms:google-services:4.1.0. Searched in the following locations:
问题描述
我正在尝试将Firebase添加到我的项目中,我正在按照Firebase文档中的步骤操作
buildscript {储存库{mavenCentral()flatDir {dirs'libs'}谷歌()}依赖项{类路径'com.android.tools.build:gradle:3.2.1'classpath'com.google.gms:google-services:4.1.0'//注意:请勿在此处放置应用程序依赖项;他们属于//在各个模块的build.gradle文件中}
}
....依赖项{实现fileTree(dir:'libs',包括:['* .jar'])实施项目(:mupdf")实现'org.altbeacon:android-beacon-library:2.+ @ aar'实施'com.android.support:appcompat-v7:22.2.1'实施'com.journeyapps:zxing-android-embedded:3.0.2@aar'实施'com.google.zxing:core:3.2.0'实施'com.android.support:support-v4:22.2.1'实施'com.android.support:design:22.2.1'实现'com.weigan:loopView:0.1.2'实施'com.google.firebase:firebase-core:16.0.5'//添加应用内消息传递依赖性:实施'com.google.firebase:firebase-inappmessaging-display:17.0.5'
}应用插件:"com.google.gms.google-services"
buildscript {储存库{mavenCentral()flatDir {dirs'libs'}谷歌()}依赖项{类路径'com.android.tools.build:gradle:3.2.1'classpath'com.google.gms:google-services:4.2.0'//注意:请勿在此处放置应用程序依赖项;他们属于//在各个模块的build.gradle文件中}}
...
依赖项{实现fileTree(dir:'libs',包括:['* .jar'])//noinspection GradleCompatible实施'com.android.support:appcompat-v7:28.0.0'实施'com.android.support:design:28.0.0'实现'com.android.support.constraint:constraint-layout:1.1.3'实施'com.google.android.gms:play-services-ads:17.1.1'testImplementation'junit:junit:4.12'androidTestImplementation'com.android.support.test:runner:1.0.2'androidTestImplementation'com.android.support.test.espresso:espresso-core:3.0.2'}应用插件:"com.google.gms.google-services"应用插件:"com.android.application"
I am trying to add firebase to my project, I am following the steps from firebase documentation https://firebase.google.com/docs/android/setup?authuser=0 help please! I am getting this error when I try to sync gradle.
Could not find com.google.gms:google-services:4.1.0. Searched in the following locations: https://repo.maven.apache.org/maven2/com/google/gms/google-services/4.1.0/google-services-4.1.0.pom https://repo.maven.apache.org/maven2/com/google/gms/google-services/4.1.0/google-services-4.1.0.jar
why is that happening, I visited this link
buildscript {
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.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
}
}
....
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(":mupdf")
implementation 'org.altbeacon:android-beacon-library:2.+@aar'
implementation 'com.android.support:appcompat-v7:22.2.1'
implementation 'com.journeyapps:zxing-android-embedded:3.0.2@aar'
implementation 'com.google.zxing:core:3.2.0'
implementation 'com.android.support:support-v4:22.2.1'
implementation 'com.android.support:design:22.2.1'
implementation 'com.weigan:loopView:0.1.2'
implementation 'com.google.firebase:firebase-core:16.0.5'
// Add the In-App Messaging depencency:
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.5'
} apply plugin: 'com.google.gms.google-services'
buildscript {
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
...
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-ads:17.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
这篇关于找不到com.google.gms:google-services:4.1.0.在以下位置搜索:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!