java.lang.NoClassDefFoundError:无法解决以下问题:Ljavax / xml / bind / DatatypeConverter

时间:2018-10-19 15:30:32

标签: android classnotfoundexception noclassdeffounderror evernote scribe

这仅在Android 9设备上发生。使用Evernote Android SDK。

我已经将我的targetSdkVersion升级到28并迁移到了androidX,现在我正在使用stacktrace在crashlytics中捕获此问题:

Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/bind/DatatypeConverter;
   at org.scribe.services.DatatypeConverterEncoder.encode(DatatypeConverterEncoder.java:10)
   at org.scribe.services.HMACSha1SignatureService.bytesToBase64String(HMACSha1SignatureService.java:51)
   at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:46)
   at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32)
   at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151)
   at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75)
   at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:55)
   at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:40)
   at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:45)
   at com.evernote.client.android.EvernoteOAuthHelper.createRequestToken(EvernoteOAuthHelper.java:106)
   at com.evernote.client.android.EvernoteOAuthHelper.startAuthorization(EvernoteOAuthHelper.java:127)
   at com.evernote.client.android.login.EvernoteLoginTask.startAuthorization(EvernoteLoginTask.java:144)
   at com.evernote.client.android.login.EvernoteLoginTask.execute(EvernoteLoginTask.java:51)
   at com.evernote.client.android.login.EvernoteLoginTask.execute(EvernoteLoginTask.java:23)
   at net.vrallev.android.task.Task.executeInner(Task.java:67)
   at net.vrallev.android.task.TaskExecutor$TaskRunnable.run(TaskExecutor.java:191)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
   at java.lang.Thread.run(Thread.java:764)

Caused by java.lang.ClassNotFoundException: Didnt find class "javax.xml.bind.DatatypeConverter" on path: DexPathList[[zip file "/data/app/com.appName-wW-VAgs8nrHvdZ5Jsbu0Ag==/base.apk"],nativeLibraryDirectories=[/data/app/com.appName-wW-VAgs8nrHvdZ5Jsbu0Ag==/lib/arm64, /data/app/com.appName-wW-VAgs8nrHvdZ5Jsbu0Ag==/base.apk!/lib/arm64-v8a, /system/lib64]]
   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
   at org.scribe.services.DatatypeConverterEncoder.encode(DatatypeConverterEncoder.java:10)
   at org.scribe.services.HMACSha1SignatureService.bytesToBase64String(HMACSha1SignatureService.java:51)
   at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:46)
   at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32)
   at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151)
   at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75)
   at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:55)
   at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:40)
   at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:45)
   at com.evernote.client.android.EvernoteOAuthHelper.createRequestToken(EvernoteOAuthHelper.java:106)
   at com.evernote.client.android.EvernoteOAuthHelper.startAuthorization(EvernoteOAuthHelper.java:127)
   at com.evernote.client.android.login.EvernoteLoginTask.startAuthorization(EvernoteLoginTask.java:144)
   at com.evernote.client.android.login.EvernoteLoginTask.execute(EvernoteLoginTask.java:51)
   at com.evernote.client.android.login.EvernoteLoginTask.execute(EvernoteLoginTask.java:23)
   at net.vrallev.android.task.Task.executeInner(Task.java:67)
   at net.vrallev.android.task.TaskExecutor$TaskRunnable.run(TaskExecutor.java:191)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
   at java.lang.Thread.run(Thread.java:764)

有没有人可以帮助我解决此问题? 根据我的发现,evernote sdk正在使用该库“ org.scribe:scribe:1.3.7”,这已经过时了,也许这就是问题所在。

Scribe Github Releases

Evernote Github Gradle

非常感谢!

0 个答案:

没有答案