강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

dckim님의 프로필 이미지
dckim

작성한 질문수

모던 안드로이드 - Jetpack Compose 입문

강의 소개

build.gradle 문의

작성

·

3.5K

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'

}

퀴즈

Jetpack Compose의 주요 특징은 무엇으로 설명되었나요?

XML 레이아웃 파일만을 사용하여 UI를 구성

기존과 근본적으로 다른 UI 코드 작성 방식

주로 백엔드 로직 개발에 집중

전통적인 View 시스템 컴포넌트의 단순 확장

답변 3

0

dckim님의 프로필 이미지
dckim
질문자

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

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

답변 감사했습니다.

오준석님의 프로필 이미지
오준석
지식공유자

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

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

0

dckim님의 프로필 이미지
dckim
질문자

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

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

오준석님의 프로필 이미지
오준석
지식공유자

재설치 해도 안 된다니 이상하네요. 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

dckim님의 프로필 이미지
dckim

작성한 질문수

질문하기