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: Undefined symbols for architecture #37241

Closed
samzhiwei opened this issue Feb 15, 2020 · 5 comments
Closed

x/mobile: Undefined symbols for architecture #37241

samzhiwei opened this issue Feb 15, 2020 · 5 comments
Labels
FrozenDueToAge 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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@samzhiwei
Copy link

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

The latest version

Does this issue reproduce with the latest release?

What did you do?

Follow the guide step by step

What did you expect to see?

Use gomoblie to build a framework for iOS

I try to build a .framework for iOS. After draging .framewok file in to a new demo project and build it in iPhoneX. Importing .framework is fine , and Xcode can completion the code automatically.

But Xcode log:

ld: warning: ignoring file ~/Libgodemo.framework/Libgodemo, file is universal (4 slices) but does not contain the arm64 architecture: ~/Libgodemo.framework/Libgodemo
Undefined symbols for architecture arm64:
"_LibgodemoGreetings", referenced from:
@objc ViewController.viewDidLoad() -> () in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The same problem come out in iOS simulator (Undefined symbols for architecture x86_64)

Then, I check the .framework file architecture symbol use lipo -info
Log:

Architectures in the fat file: ~/Libgodemo.framework/Versions/A/Libgodemo are: armv7 i386 x86_64 arm64

The .framework file is support arm64, but Xcode ignore the file due to its unsupport arm64. Any idea for this?

@toothrot toothrot changed the title Undefined symbols for architecture x/mobile: Undefined symbols for architecture Feb 18, 2020
@gopherbot gopherbot added this to the Unreleased milestone Feb 18, 2020
@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Feb 18, 2020
@toothrot toothrot added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Feb 18, 2020
@toothrot
Copy link
Contributor

Can you please provide the output of go version and go env from the issue template? This information is critical in investigating this kind of issue.

/cc @hyangah

@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@hiteshjoshi
Copy link

I am going through the same issue. I think its similar to this #28517

@hiteshjoshi
Copy link

hiteshjoshi commented May 6, 2020

Greeter.framework is compiled by gomobile , dragged to xcode as library.
The error is

ld: warning: ignoring file /Users/hitesh/Downloads/GoMobileTest/Greeter.framework/Greeter, file is universal (4 slices) but does not contain the arm64 architecture: /Users/hitesh/Downloads/GoMobileTest/Greeter.framework/Greeter

Undefined symbols for architecture arm64:
  "_GreeterNewGreeter", referenced from:
      GoMobileTest.ViewController.viewDidLoad() -> () in ViewController.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/hitesh/Library/Caches/go-build"
GOENV="/Users/hitesh/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Volumes/Projects/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/hitesh/sdk/go1.13.3"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/hitesh/sdk/go1.13.3/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/b3/vc02w5c12d9ghxn16_jnb4gc0000gn/T/go-build555747915=/tmp/go-build -gno-record-gcc-switches -fno-common"
go version go1.13.3 darwin/amd64
gomobile version +4c31acb Sun Mar 29 12:56:38 2020 +0000 (android,ios); androidSDK=
xcode Version 11.4 (11E146)

@hiteshjoshi
Copy link

@golang golang locked and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants