{"record":{"id":"f2e14352405d40c6","repo":"fyne-io/fyne","slug":"unsupported-architecture","errorCode":null,"errorMessage":"unsupported architecture: ","messagePattern":"unsupported architecture: ","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/fyne/internal/mobile/env.go","lineNumber":401,"sourceCode":"\t\tif util.Exists(toolPath) {\n\t\t\treturn toolPath\n\t\t} else if runtime.GOOS == \"windows\" {\n\t\t\t// On windows some of the NDK executable have a .exe extension and some don't, so try both.\n\t\t\ttoolPath += \".exe\"\n\t\t\tif util.Exists(toolPath) {\n\t\t\t\treturn toolPath\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\"\n}\n\ntype ndkConfig map[string]ndkToolchain // map: GOOS->androidConfig.\n\nfunc (nc ndkConfig) Toolchain(arch string) ndkToolchain {\n\ttc, ok := nc[arch]\n\tif !ok {\n\t\tpanic(`unsupported architecture: ` + arch)\n\t}\n\treturn tc\n}\n\nvar ndk = ndkConfig{\n\t\"arm\": {\n\t\tarch:        \"arm\",\n\t\tabi:         \"armeabi-v7a\",\n\t\tminAPI:      16,\n\t\ttoolPrefix:  \"arm-linux-androideabi\",\n\t\tclangPrefix: \"armv7a-linux-androideabi\",\n\t},\n\t\"arm64\": {\n\t\tarch:        \"arm64\",\n\t\tabi:         \"arm64-v8a\",\n\t\tminAPI:      21,\n\t\ttoolPrefix:  \"aarch64-linux-android\",\n\t\tclangPrefix: \"aarch64-linux-android\",","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/fyne-io/fyne/blob/8860ee95c356385effa5a7be51adb11c6be9d2b6/cmd/fyne/internal/mobile/env.go#L383-L419","documentation":"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.","triggerScenarios":"An Android build whose target list includes a GOARCH outside {arm, arm64, 386, amd64}, e.g. 'fyne package -os android -target android/riscv64'.","commonSituations":"Speculative targets for future Android ABIs before fyne/gomobile support them; scripts forwarding an arbitrary GOARCH into -target.","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"],"exampleFix":"# before\nfyne package -os android -target android/arm64,android/riscv64\n\n# after\nfyne package -os android -target android/arm64,android/amd64","handlingStrategy":"validation","validationCode":"// Pre-flight: verify each android target against the toolchain map keys.\nvar androidABI = map[string]bool{\"arm\": true, \"arm64\": true, \"386\": true, \"amd64\": true}\nfunc validateAndroidTargets(list []string) error {\n    for _, t := range list {\n        if !androidABI[t] { return fmt.Errorf(\"unsupported android target %q\", t) }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["android","ndk","abi","target","go"],"backgroundTag":null,"analyzedSha":"8860ee95c356385effa5a7be51adb11c6be9d2b6","analyzedAt":"2026-08-15T22:01:51.624Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}