pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

錯誤:(26, 0) 找不到 Gradle DSL 方法:'runProguard()

Error:(26, 0) Gradle DSL method not found: #39;runProguard()#39;(錯誤:(26, 0) 找不到 Gradle DSL 方法:runProguard())
本文介紹了錯誤:(26, 0) 找不到 Gradle DSL 方法:'runProguard()'的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用帶有 gradle 的 android studio 0.9.3 'com.android.tools.build:gradle:0.14.+'

I'm using android studio 0.9.3 with gradle 'com.android.tools.build:gradle:0.14.+'

應用插件:'com.android.application'

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion '20.0.0'

    defaultConfig {
        applicationId "xxx.xxx.xxx"
        minSdkVersion 16
        targetSdkVersion 19
        versionCode 1
        versionName "1.0.11"
    }

    signingConfigs{
        releaseConfig{
            storeFile file("xxxxxxx")
            storePassword = "xxxx"
            keyAlias = "xxxx"
            keyPassword = "xxxx"
        }
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.releaseConfig

            // adds version to file name
            applicationVariants.all { variant ->
                def file = variant.outputFile
                variant.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
            }
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    // You must install or update the Google Repository through the SDK manager to use this dependency.
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    compile 'com.android.support:support-v4:19.+'
    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.mcxiaoke.volley:library:1.0.6'
    compile 'com.google.code.gson:gson:2.2.+'
}

之前編譯的項目沒有對該文件進行任何更改,我越來越:錯誤:(26, 0) Gradle DSL 方法未找到:'runProguard()'

The project compiled before without any changes in that file, I'm getting: Error:(26, 0) Gradle DSL method not found: 'runProguard()'

如何解決?

推薦答案

據(jù)我所知 runProguard 被替換為 minifyEnabled.我仍然不確定如何為 proguard 定義配置,但 Google 搜索應該可以幫助您找出答案.

As far as I know runProguard was replaced with minifyEnabled. I am still not sure how to define the config for proguard but a Google search should help you to find out.

對于 outFile,請閱讀此處:https://groups.google.com/forum/#!topic/adt-dev/4_-5NvxuFB0 他們是怎么做的.

For the outFile read here: https://groups.google.com/forum/#!topic/adt-dev/4_-5NvxuFB0 how they do it.

簡而言之:他們使用了更復雜的版本:

In short: they used a more complex version:

applicationVariants.all { variant ->

    variant.outputs.each { output ->

        def apk = output.outputFile;
        def newName;

        // newName = apk.name.replace(".apk", "-v" + defaultConfig.versionName + "-" + variant.buildType.name.toUpperCase() + ".apk");
        if (variant.buildType.name == "release") {
            newName = apk.name.replace(".apk", "-v" + defaultConfig.versionName + "-release.apk");
        } else {
            newName = apk.name.replace(".apk", "-v" + defaultConfig.versionName + "-beta.apk");
        }

        output.outputFile = new File(apk.parentFile, newName);

        if (output.zipAlign) {
            output.outputFile = new File(apk.parentFile, newName.replace("-unaligned", ""));
        }

        logger.info('INFO: Set outputFile to ' + output.outputFile + " for [" + output.name + "]");
    }
}

這篇關(guān)于錯誤:(26, 0) 找不到 Gradle DSL 方法:'runProguard()'的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現(xiàn) IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當前風味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風味庫的多風味應用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 手持气象站_便携式气象站_农业气象站_负氧离子监测站-山东万象环境 | 锂电叉车,电动叉车_厂家-山东博峻智能科技有限公司 | 玻璃瓶厂家_酱菜瓶厂家_饮料瓶厂家_酒瓶厂家_玻璃杯厂家_徐州东明玻璃制品有限公司 | KBX-220倾斜开关|KBW-220P/L跑偏开关|拉绳开关|DHJY-I隔爆打滑开关|溜槽堵塞开关|欠速开关|声光报警器-山东卓信有限公司 | 智慧物联网行业一站式解决方案提供商-北京东成基业 | 艺术漆十大品牌_艺术涂料加盟代理_蒙太奇艺术涂料厂家品牌|艺术漆|微水泥|硅藻泥|乳胶漆 | 杭州|上海贴标机-百科| 宁夏活性炭_防护活性炭_催化剂载体炭-宁夏恒辉活性炭有限公司 | 河南包装袋厂家_河南真空袋批发价格_河南服装袋定制-恒源达包装制品 | 盐水蒸发器,水洗盐设备,冷凝结晶切片机,转鼓切片机,絮凝剂加药系统-无锡瑞司恩机械有限公司 | 手表腕表维修保养鉴定售后服务中心网点 - 名表维修保养 | 武汉高低温试验机-现货恒温恒湿试验箱-高低温湿热交变箱价格-湖北高天试验设备 | MES系统工业智能终端_生产管理看板/安灯/ESOP/静电监控_讯鹏科技 | 耐力板-PC阳光板-PC板-PC耐力板 - 嘉兴赢创实业有限公司 | 都江堰招聘网-都江堰人才网 都江堰人事人才网 都江堰人才招聘网 邢台人才网_邢台招聘网_邢台123招聘【智达人才网】 | 动库网动库商城-体育用品专卖店:羽毛球,乒乓球拍,网球,户外装备,运动鞋,运动包,运动服饰专卖店-正品运动品网上商城动库商城网 - 动库商城 | 余姚生活网_余姚论坛_余姚市综合门户网站 | 美缝剂_美缝剂厂家_美缝剂加盟-地老板高端瓷砖美缝剂 | 变压器配件,变压器吸湿器,武强县吉口变压器配件有限公司 | 日本SMC气缸接头-速度控制阀-日本三菱伺服电机-苏州禾力自动化科技有限公司 | 净水器代理,净水器招商,净水器加盟-FineSky德国法兹全屋净水 | FFU_空气初效|中效|高效过滤器_空调过滤网-广州梓净净化设备有限公司 | 熔体泵|换网器|熔体齿轮泵|熔体计量泵厂家-郑州巴特熔体泵有限公司 | 定时排水阀/排气阀-仪表三通旋塞阀-直角式脉冲电磁阀-永嘉良科阀门有限公司 | 衡阳耐适防护科技有限公司——威仕盾焊接防护用品官网/焊工手套/焊接防护服/皮革防护手套 | 爱佩恒温恒湿测试箱|高低温实验箱|高低温冲击试验箱|冷热冲击试验箱-您身边的模拟环境试验设备技术专家-合作热线:400-6727-800-广东爱佩试验设备有限公司 | 纳米涂料品牌 防雾抗污纳米陶瓷涂料厂家_虹瓷科技 | 分子精馏/精馏设备生产厂家-分子蒸馏工艺实验-新诺舜尧(天津)化工设备有限公司 | 砂尘试验箱_淋雨试验房_冰水冲击试验箱_IPX9K淋雨试验箱_广州岳信试验设备有限公司 | 吉林污水处理公司,长春工业污水处理设备,净水设备-长春易洁环保科技有限公司 | 合肥角钢_合肥槽钢_安徽镀锌管厂家-昆瑟商贸有限公司 | 绿叶|绿叶投资|健康产业_绿叶投资集团有限公司 | 定制液氮罐_小型气相液氮罐_自增压液氮罐_班德液氮罐厂家 | 焊缝跟踪系统_激光位移传感器_激光焊缝跟踪传感器-创想智控 | 食品无尘净化车间,食品罐装净化车间,净化车间配套风淋室-青岛旭恒洁净技术有限公司 | 事迹材料_个人事迹名人励志故事 学生作文网_中小学生作文大全与写作指导 | 冷轧机|两肋冷轧机|扁钢冷轧机|倒立式拉丝机|钢筋拔丝机|收线机-巩义市华瑞重工机械制造有限公司 | 24位ADC|8位MCU-芯易德科技有限公司| 苗木价格-苗木批发-沭阳苗木基地-沭阳花木-长之鸿园林苗木场 | 空调风机,低噪声离心式通风机,不锈钢防爆风机,前倾皮带传动风机,后倾空调风机-山东捷风风机有限公司 | 众品家具网-家具品牌招商_家具代理加盟_家具门户的首选网络媒体。 |