MappingJackson2HttpMessageConverter 导入失败

MappingJackson2HttpMessageConverter import failed

我正在尝试使用 android 注释制作 REST api 客户端 class,我正处于这个库的学习阶段,我正在使用相同的 class在 REST client 的 android 注释维基页面中给出,关于此代码我有以下问题。

问题:

  1. 如何导入 MappingJackson2HttpMessageConverter ,我无法 导入这个 class?

尝试:我的 build.gradle 看起来像这样:

apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = "4.0.0"
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.android.support:design:23.1.1'
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    apt "org.androidannotations:rest-spring:$AAVersion"
    compile "org.androidannotations:rest-spring-api:$AAVersion"

    compile 'com.fasterxml.jackson.core:jackson-core:2.7.3'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.3'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3'

}
  1. 除了原来的wiki还有什么好的教程可以学习吗 并使用 android 注释 REST ?

提前致谢

你必须添加这个

repositories {
  maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}

dependencies {
  compile "org.springframework.android:spring-android-rest-template:2.0.0.M3"
}

正如 AA wiki 所说,您必须确保您的项目中有 Spring REST 依赖项。