当我使用Retrofit和Realm时,android得到DuplicateFileException错误

时间:2016-06-04 19:34:41

标签: android

在我的应用程序中我尝试使用RetrofitRealm数据库解决方案,但在编译项目后创建apk我得到以下错误:

   Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
    > com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: 
Duplicate files copied in APK META-INF/services/javax.annotation.processing.Processor
   File1: /home/mahdi/.gradle/caches/modules-2/files-2.1/io.realm/realm-android/0.84.1/b86074e6240f0f876701810a047b0261f7bd060e/realm-android-0.84.1.jar
   File2: /home/mahdi/.gradle/caches/modules-2/files-2.1/com.jakewharton/butterknife/7.0.1/d5d13ea991eab0252e3710e5df3d6a9d4b21d461/butterknife-7.0.1.jar

我的gradle个依赖关系:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.android.support:design:23.0.1'

    ...

    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'io.realm:realm-android:0.84.1'
}

0 个答案:

没有答案