ビルドエラー

345 views
Skip to first unread message

一朗鈴木

unread,
Dec 23, 2022, 6:50:33 AM12/23/22
to android-g...@googlegroups.com
久しぶりにAndroid開発をしようとソースを入力してビルドを掛けたところ、
以下のエラーが出ました。

> Task :app:checkDebugAarMetadata FAILED

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find androidx.appcompat:appcompat:1.6.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
       - https://repo.maven.apache.org/maven2/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
     Required by:
         project :app
   > Could not find androidx.appcompat:appcompat:1.6.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
       - https://repo.maven.apache.org/maven2/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
     Required by:
         project :app > com.google.android.material:material:1.6.0
   > Could not find androidx.appcompat:appcompat:1.6.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
       - https://repo.maven.apache.org/maven2/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
       - https://jcenter.bintray.com/androidx/appcompat/appcompat/1.6.0/appcompat-1.6.0.pom
     Required by:
         project :app > androidx.constraintlayout:constraintlayout:2.1.4

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
****************************************
build.gradle(app)の中身は以下のとおりです。

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 31
    buildToolsVersion "30.0.2"

    defaultConfig {
        applicationId "com.test.XXX"
        minSdkVersion 29
        targetSdkVersion 30
        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
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.6.0'
    implementation 'com.google.android.material:material:1.6.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}
*******************************************************************

原因を教えていただけないでしょうか。


一朗鈴木

unread,
Dec 25, 2022, 3:49:59 AM12/25/22
to android-g...@googlegroups.com
自己解決できました。


2022年12月23日(金) 20:49 一朗鈴木 <zsuzu...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages