jenkins 集成gradle自动打apk无法输出构建历史 No artifacts found that match the file pattern, Configuration error?
2016-12-16 14:25
4647 查看
Build step 'Invoke Gradle script' changed build result to SUCCESS
Archiving artifacts
ERROR: No artifacts found that match the file pattern "\\*********\apkpkg\*.apk". Configuration error?
ERROR: '\\1*******\apkpkg\*.apk' doesn't match anything: '' exists but not '\\********\apkpkg\*.apk'
Build step 'Archive the artifacts' changed build result to FAILURE
Finished: FAILURE
Archive the artifacts这里面填了**/*.apk,或者百度上一些其他的配置,最后总是导致,明明构建成功了,却没办法在指定的地方输出apk。很恼火,最后经过了一翻折腾,最后发现我们还要在build.gradle文件中去设置一些配置项。最后才可以直接走通
不废话。直接上成功图。
------------------------------------------------------------------------------------------------------------------------我是分割线-----------------------------------------------------------------------》
在你的build的文件中,有一个buildtype的属性,要在这里配一点东西。。
applicationVariants.all { variant ->
variant.outputs.each { output ->
def apk = output.outputFile
if (apk != null && apk.name.endsWith('.apk')) {
def fileName = "cmfchina_v${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}.apk"
output.outputFile = new File(apk.parent + "/package", fileName)
}
}
}
在android{}节点外,有需要还要加上这么一段代码,来取得系统时间,
def releaseTime() {
return new Date().format("yyyy-MM-dd_hh-mm-ss", TimeZone.getTimeZone("GMT+08:00"))
}
详解代码;
fileName:这就是文件名称了,我这里拼接了一些信息。所以也就是打完包出来的这个名字cmfchina_v3.1.0_2016-12-16_01-36-28_cmfchina.apk。大家自行拆分,
cmfchina_v${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}.apk。。对比,${variant.productFlavors[0].name}这一块你们可能会编译不通过,因为我引用了渠道名,你们随便写点abc就可以了,然后保存。然后检查Jenkins的配置
没问题就构建把,愉快的成功吧
Archiving artifacts
ERROR: No artifacts found that match the file pattern "\\*********\apkpkg\*.apk". Configuration error?
ERROR: '\\1*******\apkpkg\*.apk' doesn't match anything: '' exists but not '\\********\apkpkg\*.apk'
Build step 'Archive the artifacts' changed build result to FAILURE
Finished: FAILURE
Archive the artifacts这里面填了**/*.apk,或者百度上一些其他的配置,最后总是导致,明明构建成功了,却没办法在指定的地方输出apk。很恼火,最后经过了一翻折腾,最后发现我们还要在build.gradle文件中去设置一些配置项。最后才可以直接走通
不废话。直接上成功图。
------------------------------------------------------------------------------------------------------------------------我是分割线-----------------------------------------------------------------------》
在你的build的文件中,有一个buildtype的属性,要在这里配一点东西。。
applicationVariants.all { variant ->
variant.outputs.each { output ->
def apk = output.outputFile
if (apk != null && apk.name.endsWith('.apk')) {
def fileName = "cmfchina_v${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}.apk"
output.outputFile = new File(apk.parent + "/package", fileName)
}
}
}
在android{}节点外,有需要还要加上这么一段代码,来取得系统时间,
def releaseTime() {
return new Date().format("yyyy-MM-dd_hh-mm-ss", TimeZone.getTimeZone("GMT+08:00"))
}
详解代码;
fileName:这就是文件名称了,我这里拼接了一些信息。所以也就是打完包出来的这个名字cmfchina_v3.1.0_2016-12-16_01-36-28_cmfchina.apk。大家自行拆分,
cmfchina_v${defaultConfig.versionName}_${releaseTime()}_${variant.productFlavors[0].name}.apk。。对比,${variant.productFlavors[0].name}这一块你们可能会编译不通过,因为我引用了渠道名,你们随便写点abc就可以了,然后保存。然后检查Jenkins的配置
没问题就构建把,愉快的成功吧
相关文章推荐
- Jenkins ERROR: No artifacts found that match the file pattern "build/*/*.ipa". Configuration error
- No artifacts found that match the file pattern
- vs2012 无法打开项目 no exports were found that match the constraint
- 修复 Visual Studio Error “No exports were found that match the constraint”
- Jenkins+Tomcat + Gradle + Tinker + Walle + 360加固 + fir.im 持续集成,自动构建
- VS 2012 No exports were found that match the constraint 解决办法
- No exports were found that match the constraint.
- Android开发中 No resource found that matches the given name 'Theme.AppCom报错以及R.java无法生成
- VS 2012 No exports were found that match the constraint 解决办法
- No exports were found that match the constraint.
- VS2012 No exports were found that match the constraint
- Android Studio Gradle编译时『No resource found that matches the given name』解决方法(windows系统的坑)
- Error in Microsoft Visual Studio 2012 :No exports were found that match the constraint
- VS 2012 No exports were found that match the constraint 解决办法
- Android Studio Gradle编译时『No resource found that matches the given name』解决方法(windows系统)
- No resource found that matches the given name
- No resource found that matches the given name
- 解决:无法检索“mvc4.Models.Movie”的元数据。The connection string in the application's configuration file does no
- Error retrieving parent for item: No resource found that matches the given name
- Android问题集锦之二十一:No resource found that matches the given name