Android studio 3.0 引起的 outputFile sync failed:not vaild
我们大多使用 android studio 改变生成安装包命名会用以下方式:
applicationVariants.all { variant -> variant.outputs.each { out -> def oFile =out.outputFile // outputFile causes failure //...
}
}
但是更新到as3.0以后,会同步失败。stackoverflow上有人(http://stackoverflow.com/questions/44044031/grade-plugin-3-alpha1-outputfile-causes-error)说:
This build error occurs because variant-specific tasks are no longer created during the configuration stage.
This results in the plugin not knowing all of its outputs up front, but it also means faster configuration times.
As an alternative, we will introduce new APIs to provide similar functionality.
查询官网介绍:https://developer.android.com/studio/preview/features/new-android-plugin-migration.html#variant_api
API change in variant output
发现解决方案:
// If you use each() to iterate through the variant objects,
// you need to start using all(). That's because each() iterates
// through only the objects that already exist during configuration time—
// but those object don't exist at configuration time with the new model.
// However, all() adapts to the new model by picking up object as they are
// added during execution.
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${variant.name}-${variant.versionName}.apk"
}
}
Android studio 3.0 引起的 outputFile sync failed:not vaild的更多相关文章
- 错误异常 (1)Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) will not work properly
[已解决]Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) wil ...
- Android Studio错误提示:Gradle project sync failed. Basic functionality (eg. editing, debugging) will not work properly
Android Studio中出现提示: Gradle project sync failed. Basic functionality (eg. editing, debugging) will n ...
- Android Studio 3.0正式版填坑之路
原文:https://www.jianshu.com/p/9b25087a5d7d Android Studio 3.0启动图 序言 总看别人的文章,今天尝试着自己来写一篇.在逛论坛时候,无意间发 ...
- Android Studio 2.0使用指南
一.下载界面.[无激活码 无序列码 无毒请放心使用][需将JAVA程序升级到1.8] 网址:http://www.android-studio.org/index.php/download/andro ...
- Android Studio 1.0.2项目实战——从一个APP的开发过程认识Android Studio
Android Studio 1.0.1刚刚发布不久,谷歌紧接着发布了Android Studio 1.0.2版本,和1.0.0一样,是一个Bug修复版本.在上一篇Android Studio 1.0 ...
- Android Studio 1.0.1 + Genymotion安卓模拟器打造高效安卓开发环境
我们开发安卓大多是使用Eclipse和安卓SDK中自带的安卓模拟器.当然,Google早就推出了自己的安卓开发环境——Android studio,在不久前,Google发布了Android Stud ...
- [Android] 环境配置之正式版Android Studio 1.0
昨天看见 Android Studio 1.0 正式版本发布了:心里挺高兴的. 算是忠实用户了吧,从去年开发者大会一开始出现 AS 后就开始使用了:也是从那时开始就基本没有用过 Eclipse 了:一 ...
- [Android] android studio 2.0即时运行功能探秘
即时运行instant Run是android studio 2中,开发人员最关心的特性之一 在google发布studio 2.0之后,马上更新体验了一把,然而发现,并没快多少,说好的即时运行呢? ...
- Windows环境下Android Studio v1.0安装教程
Windows环境下Android Studio v1.0安装教程 准备工具 JDK安装包. 要求:JDK 7以及以上版本. Android Studio安装文件. Windows: exe(包含SD ...
随机推荐
- 老李教你性能测试监控工具nmon
老李教你性能测试监控工具nmon loadrunner的某些性能监控器不够强大,这就需要我们利用更好的工具进行监控,在项目中我们会用nmon工具作为辅助性能监控的工具,帮助我们进行性能分析,pop ...
- Android可以换行的布局
本文讨论的是下图的这种数据展示方式 通过本文可以学到的内容 ===View绘制的工作流程measure和Layout,即测量和布局: ===动态创建和添加子View,以及设置点击事件的一种思路 1.主 ...
- node服务成长之路
我们的系统也从第一代平台开始到现在第四代平台更换中,对这四代平台做一个简单的介绍: 第一代平台,主要是集中式,以快速上线为目的:第二代平台主要是分布式改造,缓解各服务压力:第三代平台主要做服务端SOA ...
- 初识JS
今儿我遇到一特别恐怖的事儿,JS 刚开始的我看到JS感觉是懵逼的,翻开第一页,感觉是棒棒哒,再看第二页,感觉是easy的,看到第三页是恐怖的,当看到的第四页的时候,我感觉今年的清明节是为我准备的 废话 ...
- zlog学习随笔
zlog1使用手册 Contents Chapter 1 zlog是什么? 1.1 兼容性说明 1.2 zlog 1.2 发布说明 Chapter 2 zlog不是什么? Chapter 3 ...
- python——文件操作
open函数,该函数用于文件处理 操作文件时,一般需要经历如下步骤: 打开文件 操作文件 一.打开文件 1 文件句柄 = open('文件路径', '模式') 打开文件时,需要指定文件路径和以何等方式 ...
- C#网络程序设计(3)网络传输编程之TCP编程
网络传输编程指基于各种网络协议进行编程,包括TCP编程,UDP编程,P2P编程.本节介绍TCP编程. (1)TCP简介: TCP是TCP/IP体系中最重要的传输层协议,它提供全双工和可 ...
- bootstrap快速入门笔记(一)
一,头部基本格式:<head lang="en"> <meta charset="UTF-8"> <meta name=" ...
- test back
python Mysql 下载地址 http://sourceforge.net/projects/mysql-python/
- Less和Sass的使用
[Less中的变量] 1.声明变量:@变量名:变量值; 使用变量:@变量名 @length:100px; @color:yellow; @opa:0.5; >>>Less中变量的类 ...