Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/mobile : 31 duplicate symbols for architecture arm64 gomobile #59822

Open
hossinasaadi opened this issue Apr 25, 2023 · 3 comments
Open

x/mobile : 31 duplicate symbols for architecture arm64 gomobile #59822

hossinasaadi opened this issue Apr 25, 2023 · 3 comments
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Milestone

Comments

@hossinasaadi
Copy link

hossinasaadi commented Apr 25, 2023

What version of Go are you using (go version)?

$ go version go1.19 darwin/arm64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/username/Library/Caches/go-build"
GOENV="/Users/username/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/username/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/username/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="./go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/60/szj959w505lbgzfxhgx3vhs40000gn/T/go-build638188752=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Use gomoblie to build 2 framework with different lib for iOS
lib1.xcframework
lib2.xcframework

add to target in xcode and when build get 31 duplicate symbols for architecture arm64 gomobile error!

there is any way to create framework with random symbols or something to prevent this error?
Xcode log:

31 duplicate symbols for architecture arm64

Linker command failed with exit code 1 (use -v to see invocation)

also i read this but no answer #37241

What did you expect to see?

What did you see instead?

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Apr 25, 2023
@gopherbot gopherbot added this to the Unreleased milestone Apr 25, 2023
@bcmills
Copy link
Contributor

bcmills commented Apr 25, 2023

(CC @golang/ios)

@bcmills
Copy link
Contributor

bcmills commented Apr 25, 2023

I believe you need to build all of the Go libraries as a single framework. (You can use a Go package with import _ "example.com/foo" statements to combine them into one target for go build.)

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 25, 2023
@hossinasaadi
Copy link
Author

@bcmills I tried it but there is a problem.
so I want to implement two different versions of the same library. when I Built the xcframework, I got conflicts in module versions, functions, and protobuf conflicts.
I think the only way is that I should build them separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Darwin
Projects
None yet
Development

No branches or pull requests

4 participants