Android的工作室找不到方法runProguard()的参数呢? [英] Android Studio Could not find method runProguard() for arguments?

查看:450
本文介绍了Android的工作室找不到方法runProguard()的参数呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java -  com.intellij.rt.execution.application.AppMain org.gradle。 launcher.GradleMain --build文件/Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle

失败:建立失败,一个例外。

* 哪里:
构建文件'/Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle'行:16

* 什么地方出了错:
出现了故障评估项目:应用程序。
>找不到方法runProguard()的参数[虚假]上BuildType_Decorated {名=释放,可调试=假,testCoverageEnabled =假,jniDebuggable =假,pseudoLocalesEnabled =假,renderscriptDebuggable =假,renderscriptOptimLevel = 3,applicationIdSuffix = NULL,versionNameSuffix = NULL ,minifyEnabled =假,zipAlignEnabled = TRUE,signingConfig = NULL,embedMicroApp = TRUE,mBuildConfigFields = {},mResValues​​ = {},mProguardFiles = [],mConsumerProguardFiles = [],mManifestPlaceholders = {}}。

* 尝试:
与--stacktrace选项获取堆栈跟踪运行。与--info或--debug选项运行,以获得更多的日志输出。

构建失败

总时间:67.41秒

流程完成出口code 1
 


 应用插件:com.android.application

安卓{
compileSdkVersion 21
buildToolsVersion21.1.0

defaultConfig {
    的applicationIDcom.poliveira.apps.materialtests
    的minSdkVersion 11
    targetSdkVersion 21
    版本code 1
    VERSIONNAME1.0
}
buildTypes {
    推出 {
        runProguard假
        proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
    }
}
}

依赖{
编译文件树(导演:库,包括:['的* .jar'])
编译com.android.support:support-v4:21.0.0
// noinspection GradleDependency
编译com.android.support:appcompat-v7:21.0.0
编译com.android.support:recyclerview-v7:21.0.0
}
 

解决方案

我有更新的Andr​​oid工作室1.0 RC 3后,同样的问题。 我在我的项目不能导入到新版本。我不得不创建一个新的项目,将文件添加到从手动previous项目新项目。

之后,我发现在摇篮构建文件的改变。

下面是变化的:

  buildTypes {
    推出 {
        minifyEnabled假
        proguardFiles getDefaultProguardFile('ProGuard的-android.txt'),'proguard-rules.pro
    }
}
 

而不是runProguard虚假使用minifyEnabled假

/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'
}    

解决方案

I had the same problem after updating android studio to 1.0 RC 3. I couldn't import my project to new version. i had to create a new project and add the files to the new project from the previous project manually.

After that I found a change in the gradle build file.

Here is the change:

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

Instead of "runProguard false" use "minifyEnabled false"

这篇关于Android的工作室找不到方法runProguard()的参数呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆