Gradle sync failed: Cannot set the value of read-only property 'outputFile'


错误

Gradle sync failed: Cannot set the value of read-only property 'outputFile'

原因

gradle打包,自定义apk名称代码报错

解决

看不懂代码就把原来的注释了,自己再写一个

例如:

// rename the apk with the version name
/*
applicationVariants.all { variant ->
    variant.outputs.each { output ->
        output.outputFile = new File(
                output.outputFile.parent + "/${variant.buildType.name}",
                "osc-android-${variant.versionName}-${variant.productFlavors[0].name}.apk".toLowerCase())
        
    }
}
*/
android.applicationVariants.all { variant ->
    variant.outputs.all {
        outputFileName = "oschain_${defaultConfig.versionName}.apk"
    }
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 执行make报错Failed to search for file: Cannot update read-only repo vscode Cannot edit in read-only editor. centos8 市场 Cannot update read-only repo 【CentOS】 8版本 Cannot update read-only repo 问题 Uncaught InvalidStateError: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string. Cannot assign to read only property 'exports' of object '#' bash: cannot create temp file for here-document: Read-only file system JavaScript Uncaught TypeError: Cannot read property 'value' of null Connection is read-only解决方式 前端:Uncaught TypeError: Cannot set property 'value' of null;
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM