Android Studio 인수에 대한 runProguard () 메서드를 찾을 수 없습니까?
/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java "- com.intellij.rt.execution.application.AppMain org.gradle.launcher.GradleMain --build-file /Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method runProguard() for arguments [false] on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, applicationIdSuffix=null, versionNameSuffix=null, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.741 secs
Process finished with exit code 1
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
applicationId "com.poliveira.apps.materialtests"
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.0'
//noinspection GradleDependency
compile "com.android.support:appcompat-v7:21.0.0"
compile 'com.android.support:recyclerview-v7:21.0.0'
}
Android 스튜디오를 1.0 RC 3으로 업데이트 한 후에도 동일한 문제가 발생했습니다. 프로젝트를 새 버전으로 가져올 수 없습니다. 새 프로젝트를 만들고 이전 프로젝트의 새 프로젝트에 수동으로 파일을 추가해야했습니다.
그 후 gradle 빌드 파일에서 변경 사항을 발견했습니다.
변경 사항은 다음과 같습니다.
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
"runProguard false"대신 "minifyEnabled false"사용
Android Studio에 대한 업데이트가 있습니다. Gradle 구성을 마이그레이션해야합니다. http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0
- runProguard를 minifyEnabled로 바꿉니다.
- zipAlign을 zipAlignEnabled로 교체
- 기타...
gradle 파일에서 runProguard를 사용하는 대신 minifyEnabled를 사용해보십시오. 이렇게하면 문제가 해결됩니다. runProguard는 더 이상 사용되지 않으며 곧 작동이 중지됩니다.
NOTE - To use minifyEnabled, gradle should be updated to version 2.2 or above.
Works for me (after updating to 1.0 "final"):
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Should to be updated too: Gradle 2.2 (or above), "SDK-Tools", Support Repository, Support Library, Play Services, etc,etc,
don't forget to change all renderscriptSupportMode to renderscriptSupportModeEnabled !
Also thoose who are in all your libs's project
you need to do couple of things to migrate from 0.9 to 1.0 see http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0
'Nice programing' 카테고리의 다른 글
HH : MM : SS 형식의 시간을 초로 만 변환 하시겠습니까? (0) | 2020.11.12 |
---|---|
Spring이 존재하는 경우 Bean xml 구성 파일을 찾을 수 없습니다. (0) | 2020.11.12 |
Spark의 CSV 파일에서 헤더를 건너 뛰려면 어떻게하나요? (0) | 2020.11.12 |
프로그래밍 방식으로 Android 앱을 종료하는 방법은 무엇입니까? (0) | 2020.11.12 |
Excel에서 열의 모든 셀에 동일한 텍스트 추가 (0) | 2020.11.12 |