Skip to content

FlatBuffers version conflicts with other library #894

@nicodubi

Description

@nicodubi

Edit: this is due to FlatBuffers versions conflicting. See the comment below for details and potential workarounds. #894 (comment)


@greenrobot-team I have the same issue of duplicated dependencies (between ObjectBox and GoogleArCore Sceneform):

Duplicate class com.google.flatbuffers.Constants found in modules jetified-flatbuffers-java-1.12.0.jar (com.google.flatbuffers:flatbuffers-java:1.12.0) and jetified-sceneform-base-1.15.0-runtime.jar (com.google.ar.sceneform:sceneform-base:1.15.0)
Duplicate class com.google.flatbuffers.FlatBufferBuilder found in modules jetified-flatbuffers-java-1.12.0.jar (com.google.flatbuffers:flatbuffers-java:1.12.0) and jetified-sceneform-base-1.15.0-runtime.jar (com.google.ar.sceneform:sceneform-base:1.15.0)
Duplicate class com.google.flatbuffers.FlatBufferBuilder$ByteBufferFactory found in modules jetified-flatbuffers-java-1.12.0.jar (com.google.flatbuffers:flatbuffers-java:1.12.0) and jetified-sceneform-base-1.15.0-runtime.jar (com.google.ar.sceneform:sceneform-base:1.15.0)
Duplicate class com.google.flatbuffers.FlatBufferBuilder$HeapByteBufferFactory found in modules jetified-flatbuffers-java-1.12.0.jar (com.google.flatbuffers:flatbuffers-java:1.12.0) and jetified-sceneform-base-1.15.0-runtime.jar (com.google.ar.sceneform:sceneform-base:1.15.0)
Duplicate class com.google.flatbuffers.Struct found in modules jetified-flatbuffers-java-1.12.0.jar (com.google.flatbuffers:flatbuffers-java:1.12.0) and jetified-sceneform-base-1.15.0-runtime.jar (com.google.ar.sceneform:sceneform-base:1.15.0)
Duplicate class com.google.flatbuffers.Table found in modules jetified-flatbuffers-java-1.12.0.jar (com.google.flatbuffers:flatbuffers-java:1.12.0) and jetified-sceneform-base-1.15.0-runtime.jar (com.google.ar.sceneform:sceneform-base:1.15.0)
Duplicate class com.google.flatbuffers.Utf8 found in modules jetified-flatbuffers-java-1.12.0.jar (com.google.flatbuffers:flatbuffers-java:1.12.0) and jetified-sceneform-base-1.15.0-runtime.jar (com.google.ar.sceneform:sceneform-base:1.15.0)
Duplicate class com.google.flatbuffers.Utf8Safe found in modules jetified-flatbuffers-java-1.12.0.jar (com.google.flatbuffers:flatbuffers-java:1.12.0) and jetified-sceneform-base-1.15.0-runtime.jar (com.google.ar.sceneform:sceneform-base:1.15.0)

If I follow the solution of @dpproduction everything works right. I mean adding:

 implementation ("io.objectbox:objectbox-android:$objectboxVersion"){
        exclude group: 'com.google.flatbuffers', module: 'flatbuffers-java'
    }
    annotationProcessor "io.objectbox:objectbox-processor:$objectboxVersion"

and removing the "apply plugin: 'io.objectbox'".

However I'm afraid of what you said of avoid removing the apply plugin.

I tried to add apply plugin: 'io.objectbox' in every ways (after dependencies block, at the beggining of the build.gradle app file, after the apply plugin: 'com.android.application') but nothing worked. Just removing the apply plugin.

Is there any solutions? What does it happen if I haven't the apply plugin? The ObjectBox library will work with errors?

Thanks!!

Originally posted by @nicodubi in #479 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions