Android Studio - Gradle 无法为任务 'mobile:javaPreCompileDebug' 捕获输入文件的快照
Android Studio - Gradle failed to capture snapshot of input files for task 'mobile:javaPreCompileDebug'
最初我在我的项目中使用 Jcabi 库。找到 Jsch 库后,我决定停止使用 Jcabi 并犯了一个不幸的错误,即删除了我项目的 libs
文件夹中的 jcabi-ssh-1.6.1.jar
:
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 对我来说是一门新语言,也是 Android 的一般开发,但它似乎仍在寻找 .jar 文件,即使没有使用库本身的任何内容在源代码中;如果我 "search everywhere"(双班),我在名为 Gradle____local_aars____[projectdirectory]_mobile_libs_jcabi_ssh_1_6_1_jar_unspecified_jar.xml
的文件中找到一个 jcabi
的实例,其中包含以下内容:
<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 and 相当于禁用 Instant 运行(运气不好)
如有必要,我可以 post 整个堆栈跟踪!
愚蠢的我,我应该立即查看 build.Gradle
(我假设 jcabi
不会在里面,因为搜索没有返回任何文本 "jcabi")
删除行后 implementation files ('libs/jcabi')
我能够成功构建。
最初我在我的项目中使用 Jcabi 库。找到 Jsch 库后,我决定停止使用 Jcabi 并犯了一个不幸的错误,即删除了我项目的 libs
文件夹中的 jcabi-ssh-1.6.1.jar
:
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 对我来说是一门新语言,也是 Android 的一般开发,但它似乎仍在寻找 .jar 文件,即使没有使用库本身的任何内容在源代码中;如果我 "search everywhere"(双班),我在名为 Gradle____local_aars____[projectdirectory]_mobile_libs_jcabi_ssh_1_6_1_jar_unspecified_jar.xml
的文件中找到一个 jcabi
的实例,其中包含以下内容:
<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 and
如有必要,我可以 post 整个堆栈跟踪!
愚蠢的我,我应该立即查看 build.Gradle
(我假设 jcabi
不会在里面,因为搜索没有返回任何文本 "jcabi")
删除行后 implementation files ('libs/jcabi')
我能够成功构建。