I am using Jackson in my android app.
I have added these two jars in my build-path:
jackson-core-asl-1.0.0.jar
jackson-mapper-asl-1.0.0.jar
But, I keep seeing this in my Logcat:
11-24 18:25:15.093: I/dalvikvm(28842): Could not find method org.codehaus.jackson.map.ObjectMapper.getTypeFactory, referenced from method org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.getJavaType
11-24 18:25:15.093: W/dalvikvm(28842): VFY: unable to resolve virtual method 17967: Lorg/codehaus/jackson/map/ObjectMapper;.getTypeFactory ()Lorg/codehaus/jackson/map/type/TypeFactory;
It's only on that method. I have searched StackOverflow on similar errors, but all of them were:
My Android version is 4.0.3. I am using this in combination with Spring Android
libraries.
I had a similar problem; assuming you're using Eclipse, try the following:
Hopefully that works.
This can also happen if you have code calling methods that don't exist in the current device OS version.
For example, if somewhere in your app you call Settings.Global.getFloat(String)
- which was added in api 17 - and the current device is running api 15, you will see this warning in your logs.
There will be a crash if you actually try to invoke this method. There is no problem if you don't call this method. So make sure you always check the current version before calling this.
private float getAnimationSetting(ContentResolver contentResolver,
String setting) throws Settings.SettingNotFoundException {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
return getAnimationSettingJB(contentResolver, setting);
} else {
return getAnimationSettingLegacy(contentResolver, setting);
}
}
private float getAnimationSettingLegacy(ContentResolver contentResolver,
String setting) throws Settings.SettingNotFoundException {
return Settings.System.getFloat(contentResolver, setting);
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private float getAnimationSettingJB(ContentResolver contentResolver,
String setting) throws Settings.SettingNotFoundException {
return Settings.Global.getFloat(contentResolver, setting);
}
In my case, this solution cannot work.
Check the code format of jar file is fit as JDK 1.6,
I found this issue via changing my lib code format from 1.7 to 1.6, and this issue would be solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With