We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jvmArgs "-javaagent:${classpath.find { it.name.contains("testable-agent") }.absolutePath}"
gradle 引包,编译提示 Cannot get property 'absolutePath' on null object
The text was updated successfully, but these errors were encountered:
和操作系统关系不大,但可能和Gradle版本以及使用的依赖声明方式有关。
这个报错的直接原因是在当前编译上下文的Classpath里找不到Testable的依赖包,首先请确保在依赖声明的地方已经通过testImplementation()声明添加了Testable的依赖,如果依然不行,最好能提供一个最小可复现问题的完整Demo,便于再进一步排查原因。
Classpath
testImplementation()
另外,我在StackOverflow上找到了一个可以参考的帖子: https://stackoverflow.com/questions/63044549/gradle-switching-to-implementation-testimplementation-causing-errors-when-acces
具体方法是将 "-javaagent:${classpath.find { it.name.contains("testable-agent") }.absolutePath}" 替换为 "-javaagent:${configurations.testCompileClasspath.get().files.filter { it.name.contains("jmockit") }[0].absolutePath}",不妨一试。
Sorry, something went wrong.
No branches or pull requests
jvmArgs "-javaagent:${classpath.find { it.name.contains("testable-agent") }.absolutePath}"
gradle 引包,编译提示
Cannot get property 'absolutePath' on null object
The text was updated successfully, but these errors were encountered: