thorbenprimke / realm-recyclerview

A RecyclerView that is powered by Realm and lots more
555 stars 151 forks source link

Attempting to use Realm-recyclerview with Object Server.... #98

Closed ericwhiteau closed 5 years ago

ericwhiteau commented 7 years ago

I am attempting to implement your realm Recyclerview with a dataset that will be central to several users, hence use of ROS.

When I attempt to add the recyclerview I get the following error. The StackOverflow discussions seem to reference where you have different versions of realm and ROS. this is not the case here.

I have also tried Packaging Options eg. / pickFirst 'lib/x86/librealm-jni.so' // pickFirst 'lib/x86_64/librealm-jni.so' // pickFirst 'lib/arm64-v8a/librealm-jni.so'

Pack options allows compile, however I then get a runtime fail not connecting to the server.

error below after adding the Realm Recycler library.

Error:Execution failed for task ':app:transformNative_libsWithMergeJniLibsForDebug'.

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK lib/x86/librealm-jni.so File1: C:\data\src\Realm\ResultList\app\build\intermediates\exploded-aar\io.realm\realm-android-library\2.2.1\jni File2: C:\data\src\Realm\ResultList\app\build\intermediates\exploded-aar\io.realm\realm-android-library-object-server\2.2.1\jni

ericwhiteau commented 7 years ago

Just to add, I understand I am getting a Dup library problem, however, I cant find how to fix it.

I have run the example code from your tutorial with success, but that didnt use the server. I have not tried to run the example on ROS.

cheers and thanks in advance.

ericwhiteau commented 7 years ago

I tried adding the Realm Server to your example code. this resulted in the same error message.

I have now copied manually each class into a realmUtils package in my project. This compiles and runs.

However, I have some issues with realmResults no being allowd across package. see below realmResults.getTableOrView().getTable().getColumnIndex(headerColumnName);

and some others. e.g. BaseRealm with swipeDismiss.

anyway I will push ahead trying to isolate it.

any thoughts or pointers would be appreciated.

monajafi commented 7 years ago

I've faced same problem when attempted to use realmrecyclerview in sync mode because of duplicate lib file error any workaround to this problem will be appreciated

adellhk commented 7 years ago

@monajafi I think I have RRV and Realm 2.2.2/ROS playing together with the packaging option: pickFirst '**/librealm-jni.so'