Closed deibid closed 8 years ago
Hi @deibid
I'll try to reproduce this issue on my macine.
One question. Are you using any library projects which uses Realm(except for realm-recyclerview)?
Thanks..
Not that I know of..
I'm basically using the AWS SDK, Google play services and Glide with GlideTransforms.
I tried to comment out the Realm-RecyclerView dependency, thinking it might be redeclaring Realm, but of course, the build fails.
Looks like the issue is present when multiple dependencies try to declare the same class.
@deibid Can you please provide the full list of your dependencies?
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.0' compile 'com.android.support:design:23.2.0' compile 'com.android.support:cardview-v7:23.2.0' compile 'com.android.support:recyclerview-v7:23.2.0'
//Google Play Services
compile 'com.google.android.gms:play-services-gcm:8.4.0'
//Realm.io related stuff
compile 'com.github.thorbenprimke:realm-recyclerview:0.9.12'
//Image Loading libs
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'jp.wasabeef:glide-transformations:2.0.0'
/* Amazon Web Services Related Libraries*/
compile 'com.amazonaws:aws-android-sdk-core:2.2.10'
compile 'com.amazonaws:aws-android-sdk-cognito:2.2.10'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.10'
compile 'com.amazonaws:aws-android-sdk-lambda:2.2.10'
compile 'com.amazonaws:aws-android-sdk-sns:2.2.10'
}
*sorry for bad formatting, can't seem to make it work from mobile
And I assume you remove the realm-android line when you update to 0.88.2, correct?
You mean the compile 'io.realm:realm-android:0.87.5'
one from the build.gradle ( Module: app ) ? Yeah, I removed it. I'll edit my last comment to remove it from this thread too.
Well, it looks like the realm-recyclerview
library depends on an old version of Realm:
https://github.com/thorbenprimke/realm-recyclerview/blob/master/library/build.gradle#L25
Some investigation is needed to figure out if such conflict can arise.
I see.. That makes sense.
So, for now, is it better to just wait before jumping to the next version or is there something we can do to integrate all of this together ?
I will try replicating the issue and see what can be done about it
Well, it looks like since the realm-recyclerview
library depends on Realm and already imports it to the project, it means that:
I think the only thing we can do now is to ask the library developer to support Realm 0.88+
I always thought that the realm-RecyclerView
was officially supported by Realm.io.
I'll issue a bug at the other site.
Thanks
Can we use this https://docs.gradle.org/current/userguide/dependency_management.html#sub:exclude_transitive_dependencies to exclude transitive dependency from realm-recyclerview
?
`
Now, i'm upgrading the version from 0.87.5 to 0.88.2 and im getting the following errors at build time
Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lio/realm/RealmCache$Callback;
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
I've tried to clean the project and invalidating cache/ restart and all the other tricks, but i cant get it to work.
_My build.gradle (Project) file is the following: _
My build.gradle (Module:app) file is the following:
I've tried changing the apply plugin: 'realm-android' tag to the Project's build.gradle file and didnt work either.
Goal
A successful build
Version of Realm and tooling
Realm version(s): ?
0.88.2
Android Studio version: ?
1.5.1
Which Android version and device: ?
HTC M8 Android 6.0