我正在使用改造库,它给出了编译错误
消息{kind = ERROR,text =程序类型已存在:retrofit2.Converter $ Factory,sources = [未知源文件],工具名称= Optional.of(D8)}
我的app/build.gradle
文件就像
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2') {exclude group: 'com.android.support', module: 'support-annotations' }
implementation 'com.android.support:appcompat-v7:27.0.0-alpha1'
implementation 'com.android.support:cardview-v7:27.0.0-alpha1'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.shrikanth7698:Custom-Navigation-Drawer:v0.0.1'
implementation files('libs/retrofit-2.4.0.jar')
implementation files('libs/converter-gson-2.4.0.jar')
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation 'com.airbnb.android:lottie:2.5.5'
implementation 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0' exclude module: 'httpclient'
implementation 'com.google.apis:google-api-services-vision:v1-rev369-1.23.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
}
从您的gradle文件中删除它(您已经在底部添加了它们):
implementation files('libs/retrofit-2.4.0.jar')
implementation files('libs/converter-gson-2.4.0.jar')
我使用了凌空和翻新。这就是造成错误的原因。我在没有使用凌空的项目中启动了项目,它已经解决了