Description
The stock Android build forwards -tags android,debug to the common frontend binding task, but the binding generator still runs with the host GOOS. On macOS this makes the Go loader select both Darwin and Android implementations, producing 98 analyzer warnings before an otherwise successful Android build.
The Android Taskfile already defines generate:android:bindings with GOOS=android and CGO_ENABLED=0, but android:build reaches common:generate:bindings through common:build:frontend instead, so the Android-specific task is not used.
Reproduction
From the stock v3/examples/mobile project on macOS arm64:
GOWORK=off wails3 generate bindings -dry -f "-tags android,debug"
The command completes with 98 warnings emitted, including pairs such as:
assetserver_darwin.go: baseURL redeclared in this block
assetserver_android.go: other declaration of baseURL
application_darwin.go: newPlatformApp redeclared in this block
application_android.go: other declaration of newPlatformApp
runtime/cgo: fatal error: android/log.h file not found
Running the same analysis with the Android target removes the host/target collisions:
GOWORK=off GOOS=android CGO_ENABLED=0 \
wails3 generate bindings -dry -f "-tags android,debug"
This reduces the result to four warnings, all caused by two missing helpers in application_android_nocgo.go:
undefined: androidBridgeVoid
undefined: androidBridgeStringString
Expected behaviour
Android binding generation should:
- load only Android-compatible source files;
- work without an installed NDK by using the non-cgo Android stubs;
- emit no platform collision or missing-stub warnings;
- leave desktop binding generation unchanged.
Environment
- Wails:
v3.0.0-alpha2.117
- Go:
go1.26.5
- Host: macOS arm64
- Reproduced with the checked-in
v3/examples/mobile project.
Description
The stock Android build forwards
-tags android,debugto the common frontend binding task, but the binding generator still runs with the hostGOOS. On macOS this makes the Go loader select both Darwin and Android implementations, producing 98 analyzer warnings before an otherwise successful Android build.The Android Taskfile already defines
generate:android:bindingswithGOOS=androidandCGO_ENABLED=0, butandroid:buildreachescommon:generate:bindingsthroughcommon:build:frontendinstead, so the Android-specific task is not used.Reproduction
From the stock
v3/examples/mobileproject on macOS arm64:GOWORK=off wails3 generate bindings -dry -f "-tags android,debug"The command completes with
98 warnings emitted, including pairs such as:Running the same analysis with the Android target removes the host/target collisions:
GOWORK=off GOOS=android CGO_ENABLED=0 \ wails3 generate bindings -dry -f "-tags android,debug"This reduces the result to four warnings, all caused by two missing helpers in
application_android_nocgo.go:Expected behaviour
Android binding generation should:
Environment
v3.0.0-alpha2.117go1.26.5v3/examples/mobileproject.