私はandroidstudioでgoogledriveAPIを使用しようとし、
(https://developers.google.com/drive/api/v3/quickstart/java#prerequisites)
に書いてあるようにbuild.gradle を変更したところエラーが発生したので
を参考にsettings.gradleを変更したところ
Plugin [id: 'com.android.application'] was not found in any of the following sources:
というエラーが出てしまいました
このエラーの解決法をご教授いただけないでしょうか
追記:何件の記事を読んだかはわからないですがその都度修正を繰り返した結果
build.gradle(:app)
java
1plugins { 2 id 'com.android.application' 3} 4 5android { 6 compileSdk 31 7 8 defaultConfig { 9 applicationId "local.hal.st31.android.drivequickstart" 10 minSdk 26 11 targetSdk 31 12 versionCode 1 13 versionName "1.0" 14 15 multiDexEnabled true 16 17 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 18 } 19 20 buildTypes { 21 release { 22 minifyEnabled false 23 proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 } 25 } 26 compileOptions { 27 sourceCompatibility JavaVersion.VERSION_1_8 28 targetCompatibility JavaVersion.VERSION_1_8 29 } 30 31 repositories { 32 google() 33 mavenCentral() 34 jcenter() 35 } 36 37 38} 39 40dependencies { 41 42 implementation 'androidx.appcompat:appcompat:1.4.1' 43 implementation 'com.google.android.material:material:1.5.0' 44 implementation 'androidx.constraintlayout:constraintlayout:2.1.3' 45 46 implementation 'com.google.api-client:google-api-client:1.33.0' 47 implementation 'com.google.oauth-client:google-oauth-client-jetty:1.32.1' 48 implementation 'com.google.apis:google-api-services-drive:v3-rev20211107-1.32.1' 49 50 implementation 'com.android.support:multidex:2.0.1' 51 52 implementation "com.android.tools.build:gradle:4.2.1" 53 54 55 //testImplementation 'junit:junit:4.13.2' 56 androidTestImplementation 'androidx.test.ext:junit:1.1.3' 57 androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 58}
build.gradle(プロジェクト名)
java
1// Top-level build file where you can add configuration options common to all sub-projects/modules. 2plugins { 3 id 'com.android.application' version '7.1.2' apply false 4 id 'com.android.library' version '7.1.2' apply false 5} 6 7allprojects { 8 repositories { 9 jcenter() 10 maven { url 'https://maven.google.com' } // 追加した行 11 } 12} 13 14task clean(type: Delete) { 15 delete rootProject.buildDir 16}
settings.gradle(プロジェクト名)
java
1pluginManagement { 2 repositories { 3 gradlePluginPortal() 4 google() 5 mavenCentral() 6 } 7} 8dependencyResolutionManagement { 9 repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) 10 repositories { 11 google() 12 mavenCentral() 13 jcenter() 14 maven { url 'https://maven.google.com' } // 追加した行 15 16 } 17} 18rootProject.name = "DriveQuickstart" 19include ':app' 20
というようになっていて
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
といったエラーが出ています
このエラー自体も調べたのですが解決法がわかりません
皆様のお力をお貸し頂けないでしょうか。
あなたの回答
tips
プレビュー