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/cmd/gomobile: build fails with SDK 34 #67496

Closed
hajimehoshi opened this issue May 18, 2024 · 2 comments
Closed

x/mobile/cmd/gomobile: build fails with SDK 34 #67496

hajimehoshi opened this issue May 18, 2024 · 2 comments
Labels
mobile Android, iOS, and x/mobile NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@hajimehoshi
Copy link
Member

Go version

go version go1.22.3 darwin/arm64

Output of go env in your module/workspace:

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

What did you do?

  1. Prepare Android SDK 34. (If there are older versions, this bug might not be reproduced.)
  2. Install gomobile (a1a533f289d32c6297d63bfdc30e42c80b5a1f55)
  3. Run gomobile build -androidapi=34 ./example/basic at the gomobile directory

For 1, I installed Android SDK 34 or newer only:

image

What did you see happen?

Error:

gomobile: go build -buildmode=c-shared -o /var/folders/cj/73zbb35j0qx5t4b6rnqq0__h0000gn/T/gomobile-work-3204247024/lib/armeabi-v7a/libbasic.so golang.org/x/mobile/example/basic failed: exit status 1
# golang.org/x/mobile/app
app/android.go:368:6: could not determine kind of name for C.ALooper_pollAll

What did you expect to see?

The build succeeds.

The related issues are:

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label May 18, 2024
@gopherbot gopherbot added this to the Unreleased milestone May 18, 2024
@hajimehoshi
Copy link
Member Author

https://developer.android.com/ndk/reference/group/looper#alooper_pollall

ALooper_pollAll should be replaced with ALooper_pollOnce.

@gopherbot
Copy link

Change https://go.dev/cl/586595 mentions this issue: all: replaced ALooper_pollAll with ALooper_pollOnce

hajimehoshi added a commit to ebitengine/gomobile that referenced this issue May 18, 2024
ALooper_pollAll is no longer available as of Android SDK 34.

Updates hajimehoshi/ebiten#2992
Updates golang/go#67496
@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label May 18, 2024
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 NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants