简体   繁体   中英

Failing to run Robolectric test

I don't know what causes the issue, but I can not run unit tests:

Execution failed for task ':module:mockableAndroidJar'.
> org.objectweb.asm.tree.ClassNode.<init>(I)V

Are there command line parameter to see the classpath? Reading few answers about similar error, looks like I have wrong asm library in my classpath

As I expected the issue was in having old asm in classpath.

You can see classpath of you gradle in start of the log. I also used next snippet to see it:

task show << {
    buildscript.configurations.classpath.each { println it }
}

And solution to solve our problem next:

classpath('com.terrafolio:gradle-jenkins-plugin:1.2.3') {
    exclude group: 'asm', module: 'asm-tree'
    exclude group: 'asm', module: 'asm'
}

And now I have another issue - lint task is failing. Looking for solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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