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