我正在使用Android Studio,想要使用Retrofit,这是一个用于Android和Java的REST客户端。
我在
我在
build.gradle
文件中添加了retrofit依赖项。因此,我可以在项目中使用它,但是当我想要执行它时,我会遇到NoClassDefFoundError
错误,该错误针对retrofit.RestAdapter$Builder
内部类。dependencies {
compile 'com.squareup.retrofit:retrofit:1.3.0'
}
谢谢您提前的帮助。
解决方案的编辑:
- 更新您的Android Studio到4.0+版本。
- 在
Preferences > Compiler > Annotation Processors > Enable Annotation processing
中启用注释。