gpt4 book ai didi

android - 错误 :(33, 0) 找不到参数的方法类路径 () [com.google.gms :google-services:3. 0.1]

转载 作者:行者123 更新时间:2023-11-30 00:07:45 26 4
gpt4 key购买 nike

正在尝试为我的 android 项目配置 Firebase。但是我收到同步错误。

build.gradle 应用目录:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.yunus.relichunter"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile 'com.google.firebase:firebase-core:11.8.0'

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.google.firebase:firebase-auth:11.8.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'
classpath 'com.google.gms:google-services:3.0.1'

}




apply plugin: 'com.google.gms.google-services'

build.gradle 根目录:

buildscript {

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'


// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

enter image description here

您可以在上图中看到错误。我尝试使用它的帮助(工具/Firebase)安装 Firebase,然后尝试正常安装。

最佳答案

正如@tyczj 所说,您不能在模块 build.gradle 中使用classpath 'com.google.gms:google-services:3.0.1'像应用程序模块)依赖 block 。您只能在您的项目root build.gradle dependencies block 中使用它。

关于android - 错误 :(33, 0) 找不到参数的方法类路径 () [com.google.gms :google-services:3. 0.1],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48689556/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com