Objectbox-java: DuplicateRelativeFileException: More than one file was found with OS independent path 'lib/x86/libobjectbox.so'

Created on 15 Nov 2017  Â·  9Comments  Â·  Source: objectbox/objectbox-java

buildscript {
     ext.objectboxVersion = '1.2.1'
}

apply plugin: 'io.objectbox'

implementation "io.objectbox:objectbox-android:$objectboxVersion"
implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
debugImplementation   "io.objectbox:objectbox-android-objectbrowser:$objectboxVersion"
kapt "io.objectbox:objectbox-processor:$objectboxVersion"

run 'app'

Caused by: com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'lib/x86/libobjectbox.so'

Android Studio 3.0
classpath 'com.android.tools.build:gradle:3.0.0'
kotlin_version = '1.1.60'

How to solve it?

Most helpful comment

I found a temporary way

 packagingOptions {
        pickFirst 'lib/x86/libobjectbox.so'
        pickFirst 'lib/armeabi-v7a/libobjectbox.so'
        pickFirst 'lib/arm64-v8a/libobjectbox.so'
}

but ...
another error came out:

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lio/objectbox/android/AndroidScheduler;

All 9 comments

I found a temporary way

 packagingOptions {
        pickFirst 'lib/x86/libobjectbox.so'
        pickFirst 'lib/armeabi-v7a/libobjectbox.so'
        pickFirst 'lib/arm64-v8a/libobjectbox.so'
}

but ...
another error came out:

Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lio/objectbox/android/AndroidScheduler;

AndroidObjectBrowser(boxStore).start(application) return false

BoxStore.isObjectBrowserAvailable() return false

how can I use AndroidObjectBrowser to check the data?

did u find how to solve the problem?

i have same problem as
More than one file was found with OS independent path 'readme.html'

you can take help from here

https://stackoverflow.com/questions/44342455/more-than-one-file-was-found-with-os-independent-path-meta-inf-license.
just add exclude 'readme.html'
Hopefully it will work.

For me the source of the error was updating 'com.google.firebase:firebase-ml-vision' version from 18.0.1 to 18.0.2 and 'com.google.firebase:firebase-ml-model-interpreter' version from 16.2.3 to 16.2.4.
Reverting them solved the issue (for now).

Does anyone have a more generic answer to this problem? Like a troubleshooting strategy

Hi i am Bhavani i am facing one issue in this ethereum-core that ie., com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'version.properties' how its solved ? Please we find out answer reply me.

This is tedious work: check if a library you depend on bundles ObjectBox classes and/or the native libraries (*.so files). This may also be due to issues with your build setup in general.

Then you can try to use PackagingOptions to pick or exclude duplicates. Or even better, remove the duplicates or ask library developers to use a dependency instead of packaging the files.
-ut

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DJafari picture DJafari  Â·  21Comments

greenrobot picture greenrobot  Â·  53Comments

GerritDeMeulder picture GerritDeMeulder  Â·  20Comments

DJafari picture DJafari  Â·  29Comments

LeeKingHung picture LeeKingHung  Â·  35Comments