Reputation: 1086
I'm using Realm with Android Studio 3.0, and I run into this problem when I start running the application. It shows an error below
Error:Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'. More than one file was found with OS independent path 'lib/arm64-v8a/librealm-jni.so'
I have tried adding
packagingOptions {
pickFirst 'lib/x86/librealm-jni.so'
}
to android { }
, but it's still not working
Here are my App Level Gradle file
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}
packagingOptions {
pickFirst 'lib/x86/librealm-jni.so'
}
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'
})
// retrofit
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta3'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.2'
compile 'me.leolin:ShortcutBadger:1.1.16@aar'
compile 'io.realm:realm-android:0.84.0'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
compile 'com.jakewharton:butterknife:8.7.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.romandanylyk:pageindicatorview:0.2.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
testCompile 'junit:junit:4.12'
}
My Top Level Gradle file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "io.realm:realm-gradle-plugin:3.3.2"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Upvotes: 0
Views: 6263
Reputation: 3565
You need to remove compile 'io.realm:realm-android:0.84.0'
from you app level gradel file.
Upvotes: 1