2017-07-16 3 views
0

私は私のアプリを実行しようとすると、私はこのエラーを取得:重複ファイル/ x86の/ librealm-jni.so

Error:Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'. 
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/x86/librealm-jni.so 
File1: /home/redsolver/.gradle/caches/modules-2/files-2.1/io.realm/realm-android/0.84.1/b86074e6240f0f876701810a047b0261f7bd060e/realm-android-0.84.1.jar 
File2: /home/redsolver/.android/build-cache/d261e339af4d29c93448691068c64db176d00257/output/jni 

私は私のプロジェクトにレルムデータベースを追加した後、このエラーを得たが。

マイアプリのbuild.gradle:

apply plugin: 'com.android.application' 
apply plugin: 'realm-android' 
    android { 
     compileSdkVersion 25 
     buildToolsVersion "25.0.2" 
     defaultConfig { 
      applicationId "net.redsolver.solver" 
      minSdkVersion 19 
      targetSdkVersion 25 
      versionCode 1 
      versionName "1.0" 
      testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
      vectorDrawables.useSupportLibrary = true 
     } 
     buildTypes { 
      release { 
       minifyEnabled false 
       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      } 
     } 
    } 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',     { 
    exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.1.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4' 
    compile 'com.google.firebase:firebase-auth:10.0.1' 
    compile 'com.google.firebase:firebase-database:10.0.1' 
    compile 'com.google.android.gms:play-services-auth:10.0.1' 
    compile 'com.google.firebase:firebase-storage:10.0.1' 
    compile 'com.vistrav:ask:2.5' 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.android.support:support-vector-drawable:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'io.paperdb:paperdb:2.1' 
    compile 'io.realm:realm-android:0.84.1' 
    compile 'com.google.firebase:firebase-crash:10.0.1' 
    testCompile 'junit:junit:4.12' 
} 

apply plugin: 'com.google.gms.google-services' 
repositories { 
    mavenCentral() 
} 

マイプロジェクトのbuild.gradle:

buildscript { 
    ext.kotlin_version = '1.1.3' 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 


     classpath 'com.google.gms:google-services:3.0.0' 
     classpath 'io.realm:realm-gradle-plugin:3.5.0' 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

私は図書館が何かを破壊していることと思いますが、私はそれを修正する方法がわかりません。あなたはアプリのbuild.gradleからcompile 'io.realm:realm-android:0.84.1'を削除する必要がアンドロイドスタジオとプレスクリーンプロジェクトに

Build > Clean Project 

または

Build > Rebuild Project 
+0

モジュールで提供への依存を変えるとそれを固定:レルムアンドロイド:0.84.1''と'classpath 'io.realm:realm-gradle-plugin:3.5.0'これは2つの全く異なるバージョンです – EpicPandaForce

答えて

1

を構築するための

+0

ありがとう、それは今動作します。 – red

0

移動します。

0

私は同様の問題を持って、そしてあなたが `「io.realmをコンパイルし、両方追加している

compile 'com.amap.api:3dmap:5.5.0' -> provided 'com.amap.api:3dmap:5.5.0' 
compile 'com.amap.api:search:5.5.0' -> provided 'com.amap.api:search:5.5.0' 
compile 'com.amap.api:location:3.6.1' -> provided 'com.amap.api:location:3.6.1' 
関連する問題