Could not find property 'outputFile' on com.android.build.gradle.internal.api.ApplicationV
16lz
2021-01-24
Android studio从1.0 RC 4升级到1.0(其实就是打了一个8M的patch)后,这个时候相应的gradle的版本也会直接使用“com.android.tools.build:gradle:1.0.0”,如果这时你在gradle文件中又用到outputFile就会出现上述的问题。好吧,其实这也是gradle团队搞的问题,有时候我们多希望gradle能像android一样,对旧版本有一个非常好的兼容性。
废话不多说,直接说怎么解决这个问题吧,这个问题的原因是outputFile这个函数被换地方了。
old:
applicationVariants.all { variant -> ...... variant.outputFile = new File(variant.outputFile.parent, name); ...... }}
new:
applicationVariants.all { variant -> ...... variant.outputs.each { output -> output.outputFile = new File(output.outputFile.parent, name); ...... }}
按上述方式改就ok了。
更多相关文章
- C语言函数的递归(上)
- android中调用共享库.so的几种方法
- Rexsee API介绍:Android(安卓)WakeLock进程持续,阻止应用休眠
- android webkit 网页标签的解析与预下载的实现
- android手机屏幕横竖屏切换禁止调用生命周期函数方法
- Android(安卓)5.0(Lollipop)中的SurfaceTexture,TextureView, Sur
- android中Bitmap数据如何释放
- android耗时任务_IntentService
- 谷歌android CTS认证