Android Studio-Gradle无法捕获任务“ mobile:javaPreCompileDebug”的输入文件的快照

时间:2018-07-23 18:17:08

标签: java android classpath jsch jcabi

最初,我在项目中使用Jcabi库。找到Jsch库后,我决定停止使用Jcabi,并不幸地犯了一个错误,即删除了我项目的jcabi-ssh-1.6.1.jar文件夹中的libs

AndroidStudioProjects/Project1/mobile/libs:
.
└── jsch-0.1.54.jar
    jcabi-ssh-1.6.1.jar

0 directories, 2 files

现在,在构建项目时,Gradle返回一些错误:

Transform output file /home/spoiledgoods/AndroidStudioProjects/Project1/mobile/libs/jcabi-ssh-1.6.1.jar does not exist.

org.gradle.api.UncheckedIOException: Failed to capture snapshot of input files for task ':mobile:javaPreCompileDebug' property 'compileClasspaths' during up-to-date check.

...

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':mobile:debugCompileClasspath'.

...

Caused by: org.gradle.api.artifacts.transform.ArtifactTransformException: Failed to transform file 'jcabi-ssh-1.6.1.jar' to match attributes {artifactType=android-classes} using transform JarTransform

...

Caused by: org.gradle.api.InvalidUserDataException: Transform output file /home/spoiledgoods/AndroidStudioProjects/Project1/mobile/libs/jcabi-ssh-1.6.1.jar does not exist.

Java和我一般来说都是Java开发的一种新语言,但是即使源代码中没有使用库本身,它似乎仍在寻找.jar文件。如果我“四处搜索”(两次移位),则会在名为jcabi的文件中找到Gradle____local_aars____[projectdirectory]_mobile_libs_jcabi_ssh_1_6_1_jar_unspecified_jar.xml的一个实例,其内容如下:

<component name="libraryTable">
  <library name="Gradle: __local_aars__:/home/spoiledgoods/AndroidStudioProjects/Project1/mobile/libs/jcabi-ssh-1.6.1.jar:unspecified@jar">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/mobile/libs/jcabi-ssh-1.6.1.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>

尝试了this onethis one,这相当于禁用了即时运行(没有运气)

如有必要,我可以发布整个堆栈跟踪信息!

1 个答案:

答案 0 :(得分:0)

对不起,我应该立即查看build.Gradle(我假设jcabi不在里面,因为搜索没有返回任何带有文本“ jcabi”的内容)

删除implementation files ('libs/jcabi')行之后,我就能够成功构建。