简体   繁体   English

Gradle任务罐不起作用

[英]gradle task jar not working

I am trying to include a file into my .jar but failed to do so, it says BUILD SUCCESSFUL but the classes.dex is never included inside the jar... I'm really stressed from this graddle stuff... any help is very appreciated, here is my gradle task: 我试图将文件包含到我的.jar文件中,但未能成功,它说BUILD SUCCESSFUL,但是classes.dex从未包含在jar文件中。非常感谢,这是我的毕业任务:

task jar(type: Jar) {
    println( "WHAT" + "${buildDir}\\classes\\classes.dex")
    include "${buildDir}\\classes\\classes.dex"
}

println resolved to existing classes.dex with the correct permission, so I don't see any trouble, I even tried copied out the classes.dex and refer it directly, still it failed. println拥有正确的权限就可以解决现有的classes.dex,所以我看不到任何麻烦,我什至尝试复制出classes.dex并直接引用它,但仍然失败。

I use apply plugin 'android-library' though not sure if that is the problem, if I apply plugin 'java' it works... 我不确定如何使用应用插件'android-library',如果我应用插件'java'的话,它可以工作...

try to change include to from 试图改变includefrom

task jar(type: Jar) {
    println( "WHAT" + "${buildDir}\\classes\\classes.dex")
    from ("${buildDir}\\classes\\classes.dex")
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM