• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

build.gradle 문의

22.03.04 11:19 작성 조회수 2.34k

0

오류만 발생하는데 설정에 문제가 있는 것인가요?

java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file C:\Users\dckim\.gradle\caches\jars-9\f63efd716e824b816dbd0b68fbcfe113\gradle-api-impldep-6.8.jar.

> org.gradle.api.GradleException: Failed to create Jar file C:\Users\dckim\.gradle\caches\jars-9\f63efd716e824b816dbd0b68fbcfe113\gradle-api-impldep-6.8.jar.

java11로 변경해도 증상은 바뀌지 않네요.

 

plugins {

    id 'com.android.application'

    id 'org.jetbrains.kotlin.android'

}

 

android {

    compileSdk 31

 

    defaultConfig {

        applicationId "kr.co.nicednr.examcomposeui"

        minSdk 21

        targetSdk 31

        versionCode 1

        versionName "1.0"

 

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        vectorDrawables {

            useSupportLibrary true

        }

    }

 

    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'

    }

    buildFeatures {

        compose true

    }

    composeOptions {

        kotlinCompilerExtensionVersion compose_version

        kotlinCompilerVersion '1.5.21'

    }

    packagingOptions {

        resources {

            excludes += '/META-INF/{AL2.0,LGPL2.1}'

        }

    }

}

 

dependencies {

 

    implementation 'androidx.core:core-ktx:1.7.0'

    implementation "androidx.compose.ui:ui:$compose_version"

    implementation "androidx.compose.material:material:$compose_version"

    implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"

    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'

    implementation 'androidx.activity:activity-compose:1.3.1'

 

    testImplementation 'junit:junit:4.13.2'

    androidTestImplementation 'androidx.test.ext:junit:1.1.3'

    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"

    debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"

 

    // ViewModel

    implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0-rc01'

}

답변 3

·

답변을 작성해보세요.

0

dckim님의 프로필

dckim

질문자

2022.03.08

최신 베타(Dolphin (2021.3.1) Canary 5)버전을 설치해도 동일하게 문제가 발생해서 타 PC에서 시도해 보니 아무 문제가 없는것을 확인했습니다.

혹시나 해서, 사내 보안 툴을 종료하고 사용해보니 잘 되더군요. 이런~

답변 감사했습니다.

보안 툴하니 생각나는것이 Android Studio 내에 proxy 설정을 건드려서 하는 방법도 있는 것 같더라고요. 

잘 해결되었다니 다행입니다.

0

dckim님의 프로필

dckim

질문자

2022.03.07

지우고 다시 해봐도 해결이 되지 않네요.

개발환경 바꾸고 나서 기본 템플릿 프로젝트를 생성해도 같은 현상이 발생되어 난감하네요.

재설치 해도 안 된다니 이상하네요. Android Studio 설치시 특별히 유의할 것은 없는데요.

참고로 안드로이드 스튜디오에 내장된 java11이 기본 사용되니 java는 별도로 설치할 필요는 없습니다.

.gradle 폴더를 아예 지워보시지요. 새로 생성될 겁니다.

0

검색을 해 보았습니다.

https://stackoverflow.com/questions/56426116/not-able-to-create-jar-file-for-gradle-project

 

다음 위치의 파일을 삭제해 보라고 하네요

C:\Users\{current user}\.gradle\caches\jars-9\jars-9.lock file