最初,我在项目中使用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 one和this one,这相当于禁用了即时运行(没有运气)
如有必要,我可以发布整个堆栈跟踪信息!
答案 0 :(得分:0)
对不起,我应该立即查看build.Gradle
(我假设jcabi
不在里面,因为搜索没有返回任何带有文本“ jcabi”的内容)
删除implementation files ('libs/jcabi')
行之后,我就能够成功构建。