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

Android builds fail on Apple M1 #2439

Closed
changkun opened this issue Sep 7, 2021 · 4 comments
Closed

Android builds fail on Apple M1 #2439

changkun opened this issue Sep 7, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@changkun
Copy link
Member

changkun commented Sep 7, 2021

Describe the bug:

The hello world example cannot be built for android on Apple M1 Macs:

package main

import (
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
)

func main() {
	app := app.New()

	w := app.NewWindow("Hello")
	w.SetContent(widget.NewLabel("Hello Fyne!"))

	w.ShowAndRun()
}

To Reproduce:

Building android will result in a direct crash in the cmd/fyne:

$ fyne package -os android -appID com.example.x
panic: unsupported GOARCH: arm64

goroutine 1 [running]:
fyne.io/fyne/v2/cmd/fyne/internal/mobile.archNDK(...)
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/mobile/env.go:330
fyne.io/fyne/v2/cmd/fyne/internal/mobile.(*ndkToolchain).Path(0x1400017f658, {0x102be02a9, 0x102be44ae}, {0x102be199c, 0x0})
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/mobile/env.go:358 +0x64
fyne.io/fyne/v2/cmd/fyne/internal/mobile.envInit()
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/mobile/env.go:141 +0x460
fyne.io/fyne/v2/cmd/fyne/internal/mobile.buildEnvInit()
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/mobile/env.go:79 +0x250
fyne.io/fyne/v2/cmd/fyne/internal/mobile.runBuildImpl(0x10300cca0)
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/mobile/build.go:93 +0x3c
fyne.io/fyne/v2/cmd/fyne/internal/mobile.runBuild(...)
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/mobile/build.go:74
fyne.io/fyne/v2/cmd/fyne/internal/mobile.RunNewBuild({0x16d5ab545, 0x14000070120}, {0x16d5ab554, 0x102bd9ea4}, {0x140002c0140, 0xd}, {0x102fbf140, 0x7}, {0x102be14bf, 0x102a839bc}, ...)
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/mobile/build.go:282 +0x244
fyne.io/fyne/v2/cmd/fyne/internal/commands.(*Packager).packageAndroid(...)
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/commands/package-mobile.go:19
fyne.io/fyne/v2/cmd/fyne/internal/commands.(*Packager).doPackage(0x14000298b60)
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/commands/package.go:228 +0x49c
fyne.io/fyne/v2/cmd/fyne/internal/commands.(*Packager).Package(0x14000298b60)
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/commands/package.go:169 +0x30
fyne.io/fyne/v2/cmd/fyne/internal/commands.Package.func1(0x140002fa000)
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/internal/commands/package.go:105 +0x24
github.com/urfave/cli/v2.(*Command).Run(0x140002a30e0, 0x1400028cd80)
        /Users/changkun/dev/changkun.de/fyne/vendor/github.com/urfave/cli/v2/command.go:163 +0x5a4
github.com/urfave/cli/v2.(*App).RunContext(0x1400029a680, {0x102d476d0, 0x140000240c8}, {0x140000201e0, 0x6, 0x6})
        /Users/changkun/dev/changkun.de/fyne/vendor/github.com/urfave/cli/v2/app.go:313 +0x618
github.com/urfave/cli/v2.(*App).Run(...)
        /Users/changkun/dev/changkun.de/fyne/vendor/github.com/urfave/cli/v2/app.go:224
main.main()
        /Users/changkun/dev/changkun.de/fyne/cmd/fyne/main.go:38 +0x23c

Device (please complete the following information):

  • OS: macOS
  • Version: 12.0 Beta (21A5506j)
  • Go version: go version devel go1.18-9133245be7 Sat Sep 4 20:35:25 2021 +0000 darwin/arm64
  • Fyne version: 2.1-develop
@changkun changkun added the unverified A bug that has been reported but not verified label Sep 7, 2021
@andydotxyz
Copy link
Member

I guess the same thing is true for linux computers trying to build from an arm64 platform?

@Jacalz
Copy link
Member

Jacalz commented Sep 7, 2021

I guess the same thing is true for linux computers trying to build from an arm64 platform?

I am not entirely sure that it is. The arm64 builds through fyne-cross are cross compiled from amd64, I think?

@andydotxyz
Copy link
Member

Yes, fyne-cross android is built from amd64 - this issue is about building arm64 isn't it?

@andydotxyz
Copy link
Member

andydotxyz commented Sep 7, 2021

Thanks, fixed on develop for darwin/arm64 specifically

@andydotxyz andydotxyz added this to the Aberlour (2.1) milestone Sep 7, 2021
@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants