问题:无法找到org / jaxen / SimpleNamespaceContext的字节码。导入用于GeoNames的Java客户端后

时间:2019-02-04 20:02:14

标签: android android-studio

关注此视频enter link description here

后出现错误

我没有问题地实现了project(':geonames-1.1.14')和project(':jdom-1.0')。

运行应用程序时出现错误。

错误:无法找到org / jaxen / SimpleNamespaceContext的字节码

org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformClassesWithInstantRunForDebug'.

Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformClassesWithInstantRunForDebug'.

Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithInstantRunForDebug'.

Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Failed to find byte code for org/jaxen/SimpleNamespaceContext

Caused by: com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Failed 
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: Failed to find byte code for org/jaxen/SimpleNamespaceContext

Caused by: java.lang.RuntimeException: java.io.IOException: Failed to find byte code for org/jaxen/SimpleNamespaceContext

Caused by: java.io.IOException: Failed to find byte code for org/jaxen/SimpleNamespaceContext
at com.android.build.gradle.internal.incremental.AsmUtils.lambda$static$0(AsmUtils.java:89)
at com.android.build.gradle.internal.incremental.AsmUtils.loadClass(AsmUtils.java:307)
at com.android.build.gradle.internal.incremental.AsmUtils.readClassAndInterfaces(AsmUtils.java:165)
at com.android.build.gradle.internal.incremental.AsmUtils.loadClass(AsmUtils.java:278)
at com.android.build.gradle.internal.incremental.IncrementalVisitor.instrumentClass(IncrementalVisitor.java:342)
at com.android.build.gradle.internal.transforms.InstantRunTransform.transformToClasses2Format(InstantRunTransform.java:406)
at com.android.build.gradle.internal.transforms.InstantRunTransform.lambda$doTransform$3(InstantRunTransform.java:268)
at com.android.build.gradle.internal.transforms.InstantRunTransform.lambda$null$4(InstantRunTransform.java:297)

这不是全部错误代码。

1 个答案:

答案 0 :(得分:0)

我有一个具有geonames-1.1.14.jarjdom-1.0.jar作为依赖项的应用程序。
当我使用minifyEnabled true构建应用程序时,会出现以下警告:

R8警告:(1条警告)
缺少类:org.jaxen.SimpleNamespaceContext

不知道您的问题是否完全相同,但是我发现的一个解决方案是在我的应用程序的build.gradle中也包含Jaxen library

dependencies {
    ...
    implementation 'jaxen:jaxen:1.2.0'
}