fyne-io/fyne · error
unsupported architecture:
Error message
unsupported architecture:
What it means
The ndk variable is a map from GOARCH to toolchain config with exactly four keys: arm, arm64, 386, amd64. Toolchain(arch) is a plain lookup that panics on a miss. It is reached whenever the Android build target list contains an architecture not present in the map.
Source
Thrown at cmd/fyne/internal/mobile/env.go:401
if util.Exists(toolPath) {
return toolPath
} else if runtime.GOOS == "windows" {
// On windows some of the NDK executable have a .exe extension and some don't, so try both.
toolPath += ".exe"
if util.Exists(toolPath) {
return toolPath
}
}
}
return ""
}
type ndkConfig map[string]ndkToolchain // map: GOOS->androidConfig.
func (nc ndkConfig) Toolchain(arch string) ndkToolchain {
tc, ok := nc[arch]
if !ok {
panic(`unsupported architecture: ` + arch)
}
return tc
}
var ndk = ndkConfig{
"arm": {
arch: "arm",
abi: "armeabi-v7a",
minAPI: 16,
toolPrefix: "arm-linux-androideabi",
clangPrefix: "armv7a-linux-androideabi",
},
"arm64": {
arch: "arm64",
abi: "arm64-v8a",
minAPI: 21,
toolPrefix: "aarch64-linux-android",
clangPrefix: "aarch64-linux-android",View on GitHub (pinned to 8860ee95c3)
Solutions
- Restrict android targets to armeabi-v7a/arm/arm64, x86/386 and x86_64/amd64
- Remove the extra arch from -target and package the supported set
- Update fyne once the architecture is added to the ndk map
Example fix
# before fyne package -os android -target android/arm64,android/riscv64 # after fyne package -os android -target android/arm64,android/amd64
Defensive patterns
Strategy: validation
Validate before calling
// Pre-flight: verify each android target against the toolchain map keys.
var androidABI = map[string]bool{"arm": true, "arm64": true, "386": true, "amd64": true}
func validateAndroidTargets(list []string) error {
for _, t := range list {
if !androidABI[t] { return fmt.Errorf("unsupported android target %q", t) }
}
return nil
} Prevention
- Default to packaging all supported ABIs (omit -target) unless a specific one is required
- Validate -target values in wrapper scripts before invoking fyne
- Watch fyne release notes when adopting new Android ABIs
When it happens
Trigger: An Android build whose target list includes a GOARCH outside {arm, arm64, 386, amd64}, e.g. 'fyne package -os android -target android/riscv64'.
Common situations: Speculative targets for future Android ABIs before fyne/gomobile support them; scripts forwarding an arbitrary GOARCH into -target.
Related errors
- unsupported GOARCH:
- unhandled token type: %T %+v
- encountered empty values slice
- TODO only know how to handle DataIntDec type here
- string lengths over 1<<15 not yet supported, got len %d
AI-assisted analysis of fyne-io/fyne@8860ee95c3 (2026-08-15).
Data as JSON: /api/errors/f2e14352405d40c6.
Report an issue: GitHub.