I am trying to use two different go packages in my android app project

I am using gomobile and each package is compiled with

gomobile bind --target=android

They are imported like this

implementation files("libs/packageone.aar")
implementation files("libs/packagetwo.aar")

and they work separateley, but they conflict when i try to run the app.

and I get the following error

Duplicate class go.Seq found in modules jetified-packageone-runtime (packageone.aar) and jetified-packagetwo-runtime (packagetwo.aar)
1

There are 1 best solutions below

0
mama On

I made an issue and got this response:

Unfortunately, that won't work.

The recommended workaround is to bind both packageone and packagetwo at once, and build one .aar.

https://github.com/golang/go/issues/56567