0

将 eclipse juno 升级到最新版本的 ADT 后,我在编译项目时遇到了问题,即使它之前工作正常。

Could not find class 'com.fasterxml.jackson.databind.ObjectMapper'

完整日志如下

05-29 12:04:04.553: E/dalvikvm(362): Could not find class 'com.fasterxml.jackson.databind.ObjectMapper', referenced from method me.agilani.android.gmitthric.SplashScreenActivity.callWebService
05-29 12:04:07.234: E/AndroidRuntime(362): FATAL EXCEPTION: main
05-29 12:04:07.234: E/AndroidRuntime(362): java.lang.NoClassDefFoundError: com.fasterxml.jackson.databind.ObjectMapper
05-29 12:04:07.234: E/AndroidRuntime(362):  at me.agilani.android.gmitthric.SplashScreenActivity.callWebService(SplashScreenActivity.java:134)
05-29 12:04:07.234: E/AndroidRuntime(362):  at me.agilani.android.gmitthric.SplashScreenActivity.access$3(SplashScreenActivity.java:89)
05-29 12:04:07.234: E/AndroidRuntime(362):  at me.agilani.android.gmitthric.SplashScreenActivity$1.run(SplashScreenActivity.java:65)
05-29 12:04:07.234: E/AndroidRuntime(362):  at android.os.Handler.handleCallback(Handler.java:587)
05-29 12:04:07.234: E/AndroidRuntime(362):  at android.os.Handler.dispatchMessage(Handler.java:92)
05-29 12:04:07.234: E/AndroidRuntime(362):  at android.os.Looper.loop(Looper.java:123)
05-29 12:04:07.234: E/AndroidRuntime(362):  at android.app.ActivityThread.main(ActivityThread.java:3683)
05-29 12:04:07.234: E/AndroidRuntime(362):  at java.lang.reflect.Method.invokeNative(Native Method)
05-29 12:04:07.234: E/AndroidRuntime(362):  at java.lang.reflect.Method.invoke(Method.java:507)
05-29 12:04:07.234: E/AndroidRuntime(362):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-29 12:04:07.234: E/AndroidRuntime(362):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-29 12:04:07.234: E/AndroidRuntime(362):  at dalvik.system.NativeStart.main(Native Method)

我已经尝试将杰克逊库升级到 2.2.1 但无济于事......有人可以帮忙吗......

4

3 回答 3

1

首先,检查您的构建路径,确保该库已添加到构建路径。此外,清理项目。

于 2013-05-29T12:21:25.077 回答
0

在以某种方式升级 IDE 后,构建路径生效。将外部 jar 从构建路径中取出,多次清理解决方案,然后再次添加它们。成功了。

于 2013-05-29T12:29:58.043 回答
0

对我来说 org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; 并且 MappingJacksonHttpMessageConverter 与 fastxml jackson 混淆了,所以在 gradle clean 之后,现在一切正常

于 2016-03-03T07:41:24.300 回答