我正在使用改造库,它给出了编译错误
Message{kind=ERROR, text=Program type already present: retrofit2.Converter$Factory, sources=[Unknown source file], tool name=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'
}
最佳答案
我同时使用了 Volley 和改造。这就是造成错误的原因。我在一个项目中启动了这个项目,没有使用volley,就解决了
关于java - 程序类型已存在 : retrofit2. Converter$Factory Retrofit 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51369545/