• 1.打包报错

    处理方式
  • 如下图,打开此文件,找到错误的文件,发现在我的布局文件里面使用了id,但是id没有定义所以出错了
  • 2.配置打包apk名字出错
  • AS 2.3.1 版本如下配置没有问题,但是3.4.1报错
buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'            // 自定义输出配置            applicationVariants.all { variant ->                variant.outputs.each { output ->                    def outputFile = output.outputFile                    if (outputFile != null && outputFile.name.endsWith('.apk')) {                        // 输出apk名称为wooyun_v1.0_wandoujia.apk                        def fileName = "mlxy${defaultConfig.versionName}_${variant.productFlavors[0].name}.apk"                        output.outputFile = new File(outputFile.parent, fileName)                    }                }            }        }    }
 Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated{apkData=Main{type=MAIN, fullName=xiaomiDebug, filters=[], versionCode=3140, versionName=3.1.4}} of type com.android.build.gradle.internal.api.ApkVariantOutputImpl.

AS 3.4.1 处理方式

buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'            // 自定义输出配置            android.applicationVariants.all { variant ->                variant.outputs.all {                    outputFileName = "crm_${defaultConfig.versionName}.apk"                }            }        }    }

更多相关文章

  1. android studio一键生成快速开发实现语言国际化
  2. Android(安卓)组件化在公用Module里实现多渠道打包配置
  3. android 源码编译导入library project
  4. APK的Platform签名的权限
  5. Android(安卓)build过程中already defined by packages/apps 的
  6. Mac android studio升级时提示 :Connection failed. Please chec
  7. Android自定义按钮样式
  8. Android存储字符串数据到txt文件
  9. [置顶] cocos2d-x 2.x版本之win32 window移植android 环境搭配

随机推荐

  1. Android手机用户隐私获取,包括读取通讯录
  2. android与Unity3D之间的相爱相杀
  3. Android(安卓)API Guides---ExoPlayer Su
  4. ReactNative Android/iOS 打包详情流程
  5. Android 平铺背景图片
  6. android中跳转系统自带的界面
  7. Android开发周刊 第一期
  8. 【Android】Android 彩信发送的两种方式+
  9. android修改手机默认音量配置
  10. Android中调用天气预报