Java目录引用snakeyaml如下
Java目录build.gradle声明 library('snakeyaml', 'org.yaml', 'snakeyaml').version('2.0')
编译会抛出以下错误,如何在Java目录本身执行排除以避免加载android.jar
* What went wrong:
Execution failed for task ':compileTestJava'.
> Could not resolve all files for configuration ':testCompileClasspath'.
> Could not find snakeyaml-2.0-android.jar (org.yaml:snakeyaml:2.0).
Searched in the following locations:
https://repo.maven.apache.org/maven2/org/yaml/snakeyaml/2.0/snakeyaml-2.0-android.jar
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org