在将com.google.gms:google-services:4.3.10作为类路径添加到项目构建后下载出现问题.g



我在尝试将应用程序连接到firebase后开始得到此错误。

这是我在gradle构建后得到的错误信息

无法获取'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.10/google-services-4.3.10.pom'。从服务器收到状态码405:Method Not Allowed

项目构建。Gradle文件内容

buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// Check that you have the following line (if not, add it):
google()  // Google's Maven repository
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

app/构建。Gradle文件内容

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.gms.google-services'
}
//apply plugin: 'com.google.gms.google-services'
android {
compileSdk 31
defaultConfig {
applicationId "com.daniel_sogbey.marmap"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildToolsVersion '31.0.0'
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:28.4.2')
implementation 'com.google.firebase:firebase-analytics-ktx'
}
googleServices { disableVersionCheck = true }

您的Gradle文件看起来很好,但是看起来您的系统无法连接Google存储库。

确保你没有运行防火墙来阻止访问。

您只能解除对活动防火墙的阻止,而不激活防火墙如果你使用的是Windows操作系统,那么

相关内容

  • 没有找到相关文章

最新更新