当我构建一个Android Java项目(gradle)时, 有时,Android Studio构建会中断,并提示:
原因:javassist.NotFoundException: /home/mi/ssd/MicoLauncher/MicoLauncher/app/build/intermediates/transforms/desugar/debug/33.jar 在javassist.JarClassPath。(ClassPoolTail.java:135)
我检查了提示文件:
~/ssd/MicoLauncher/MicoLauncher/app/build/intermediates/transforms/desugar/debug$ ls
0.jar 105.jar 111.jar 118.jar 124.jar 130.jar 137.jar 143.jar 19.jar 26.jar 32.jar 3.jar 46.jar 52.jar 59.jar 65.jar 71.jar 78.jar 85.jar 91.jar 98.jar
1 106.jar 112.jar 119.jar 125.jar 131.jar 138.jar 144.jar 20.jar 27.jar 34.jar 40.jar 47.jar 53.jar 5.jar 66.jar 72.jar 79.jar 86.jar 92.jar 99.jar
100.jar 107.jar 113.jar 11.jar 126.jar 132.jar 139.jar 14.jar 21.jar 28.jar 35.jar 41.jar 48.jar 54.jar 60.jar 67.jar 73.jar 7.jar 87.jar 93.jar __content__.json
在那里不存在。
为什么? 我知道重建会成功,但是根本原因是什么, 它经常发生,是否是Android Studio编译器错误?
编译SDK版本:27 目标SDK版本:27
更多Android Studio输出:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithRealmTransformerForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter.execute(SkipCachedTaskExecuter.java:108)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at
org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 34 more
Caused by: javassist.NotFoundException: /home/mi/ssd/MicoLauncher/MicoLauncher/app/build/intermediates/transforms/desugar/debug/33.jar
at javassist.JarClassPath.<init>(ClassPoolTail.java:135)
at javassist.ClassPoolTail.makePathObject(ClassPoolTail.java:257)
at javassist.ClassPoolTail.appendClassPath(ClassPoolTail.java:249)
at javassist.ClassPool.appendClassPath(ClassPool.java:1004)
at io.realm.transformer.ManagedClassPool.<init>(ManagedClassPool.kt:51)
at io.realm.transformer.build.BuildTemplate.prepareReferencedClasses(BuildTemplate.kt:77)
at io.realm.transformer.RealmTransformer.transform(RealmTransformer.kt:101)
at com.android.build.api.transform.Transform.transform(Transform.java:288)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 49 more