Android Studio Could not find method runProguard() for arguments?

末鹿安然 提交于 2019-11-28 04:27:23

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"

There is an update with Android Studio, you need to migrate your Gradle configurations : http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0

  • Replace runProguard with minifyEnabled
  • Replace zipAlign with zipAlignEnabled
  • etc...

Instead of using runProguard in your gradle file, try using minifyEnabled. This should fix the issue. runProguard is deprecated and soon be stop working.

NOTE - To use minifyEnabled, gradle should be updated to version 2.2 or above.

KNU

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!