簡単なAndroidアプリケーションを作成しようとしています。私はAndroid Studioの最新バージョンを持っていると私は両方のgradleのビルドファイルが正しいと思います。私のアプリケーションでcom.google.android.gms:play-services-maps:11.2.0を使用するとエラーが発生する
私は、アプリのGradleの依存関係で
implementation 'com.google.android.gms:play-services-maps:11.2.0'
を配置しています。
Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.google.android.gms:play-services-maps:11.2.0.
私は様々なリンクを見て、提案された解決策を試してみたが、どれも私のために働いていないしている:
このため、私は次のエラーを取得します。
以下は両方のグラデルルビルドファイルです。
プロジェクトのbuild.gradle:
//Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://repo.situm.es/artifactory/libs-release-local" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
アプリのbuild.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "demo.situm.situmapp"
minSdkVersion 21
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'
matchingFallbacks = ['release', 'debug']
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-maps:11.2.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'
}
//apply plugin: 'com.google.gms.google-services'
はあなたが助けることができると思います。
おかげで、 カビール
https://stackoverflow.com/questions/45692460/failed-to-resolve-com-google-android-gmsplay-services-in-intellij-idea-withに相当します-grなぜコメント '//プラグインを適用する: 'com.google.gms.google-services'' –
ちょっとAmiya、コメントを外すと余分なエラーが出る:' app @ debug/compileClasspath 'の依存関係を解決できない: com.google.firebase:firebase-core:11.2.0を解決できませんでした。 – Kabir
は 'classpath 'com.google.gms:google-services:3.1.1'''を設定しました.Playサービス' 11.6.0'が起動しました。 –