本文介绍了设置输出文件名时不支持绝对路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在关注这个Android教程如何创建Android图标包App - Prototypr [ ^ ]。当我将项目导入Android Studio并构建它时,我收到以下错误 android - 无法为ApkVariantOutputImpl_Decorated设置只读属性'outputFile'的值 - Stack Overflow [ ^ ]。 我解决了,因为那里已经提到了答案。之后,当我尝试构建项目时,我收到以下错误 - 设置输出文件名时不支持绝对路径。 当我在Android中打开文件时Studio,它显示错误发生在以下代码: android { compileSdkVersion 23 buildToolsVersion23.0.2 applicationVariants.all {variant - > variant.outputs.each {output - > output.outputFileName = new File( output.outputFile.parent,MyIconPack - $ {variant.versionName} .apk)} } 请帮我解决这个错误。 我的尝试: 我在StackOverflow和谷歌搜索,但找不到合适的解决方案。解决方案 {variant.versionName} .apk)} } 请帮我解决这个问题错误。 我尝试了什么: 我在StackOverflow中搜索和谷歌,但找不到合适的解决方案。 I was following this android tutorial How To Create An Android Icon Pack App – Prototypr[^]. When I imported the project to Android Studio and built it I got the following error android - Cannot set the value of read-only property 'outputFile' for ApkVariantOutputImpl_Decorated - Stack Overflow[^].I solved that as the answer was already mentioned there. After that when I tried to build the project I got the following error - Absolute path are not supported when setting an output file name.When I opened the file in Android Studio, it showed that the error was occuring at the following code:android { compileSdkVersion 23 buildToolsVersion "23.0.2" applicationVariants.all { variant -> variant.outputs.each { output -> output.outputFileName = new File( output.outputFile.parent, "MyIconPack-${variant.versionName}.apk") } }Please help me to solve this error.What I have tried:I searched in StackOverflow and google, but can't find a proper solution. 解决方案 {variant.versionName}.apk") } }Please help me to solve this error.What I have tried:I searched in StackOverflow and google, but can't find a proper solution. 这篇关于设置输出文件名时不支持绝对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-14 22:32