티스토리 뷰

반응형

Stack Overflow에 자주 검색, 등록되는 문제들과 제가 개발 중 찾아 본 문제들 중에서 나중에도 찾아 볼 것 같은 문제들을 정리하고 있습니다.

Stack Overflow에서 가장 먼저 확인하게 되는 가장 높은 점수를 받은 Solution과 현 시점에 도움이 될 수 있는 가장 최근에 업데이트(최소 점수 확보)된 Solution을 각각 정리하였습니다.

 

아래 word cloud를 통해 이번 포스팅의 주요 키워드를 미리 확인하세요.

Gradle DSL method not found: 'runProguard'

Gradle DSL method not found: 'runProguard' 오류 수정하기

 문제 내용 

I get an error after updating from my last project. Not a problem in my code but I'm having trouble with build.gradle. How can I fix it?

이전 프로젝트에서 업데이트를 한 후에 오류가 발생합니다. 코드에 문제는 없지만 build.gradle에서 문제가 있습니다. 이를 어떻게 해결할 수 있을까요?

 

build.gradle code here:

build.gradle 코드는 다음과 같습니다:
apply plugin: 'android'

android {
    compileSdkVersion 21
    buildToolsVersion '20.0.0'

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
    }

    defaultConfig {
        applicationId 'com.xxx.axxx'
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 6
        versionName '1.0'
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
    compile files('libs/commons-codec-1.8.jar')
    compile files('libs/asmack-android-8-4.0.4.jar')
    compile 'com.android.support:support-v4:21.0.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.jakewharton:butterknife:5.1.1'
}

 

Gradle Sync message output:

Gradle Sync 메시지 출력:
Error:(27, 0) Gradle DSL method not found: 'runProguard()'
**Possible causes:
The project 'Atomic4Mobile' may be using a version of Gradle that does not contain the method.
**Gradle settings**
The build file may be missing a Gradle plugin.
**Apply Gradle plugin**

 

 

 높은 점수를 받은 Solution 

enter image description hereIf you are using version 0.14.0 or higher of the gradle plugin, you should replace "runProguard" with "minifyEnabled" in your build.gradle files.

만약 gradle 플러그인 버전 0.14.0 이상을 사용하고 있다면, build.gradle 파일에서 "runProguard"를 "minifyEnabled"로 바꾸어야 합니다.

 

runProguard was renamed to minifyEnabled in version 0.14.0. For more info, See Android Build System

버전 0.14.0에서 runProguard는 minifyEnabled로 이름이 변경되었습니다. 자세한 내용은 Android Build System을 참조하십시오.

 

 

 

 가장 최근 달린 Solution 

By changing runProguard to minifyEnabled, part of the issue gets fixed.

runProguard를 minifyEnabled로 변경함으로써 문제의 일부가 해결됩니다.

 

But the fix can cause "Library Projects cannot set application Id" (you can find the fix for this here Android Studio 1.0 and error "Library projects cannot set applicationId").

하지만 이 수정은 "Library Projects cannot set application Id" 오류를 유발할 수 있습니다. 이에 대한 해결 방법은 "Android Studio 1.0 and error 'Library projects cannot set applicationId'"에서 찾을 수 있습니다.

 

By removing application Id in the build.gradle file, you should be good to go.

build.gradle 파일에서 application Id를 제거하면 문제가 해결됩니다.

 

 

 

출처 : https://stackoverflow.com/questions/27078075/gradle-dsl-method-not-found-runproguard

반응형
댓글
공지사항
최근에 올라온 글