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

Can't build Android app on ARM macOS: image platform (linux/amd64) does not match the expected platform (linux/arm64) #219

Open
fortuna opened this issue Jan 13, 2024 · 4 comments

Comments

@fortuna
Copy link

fortuna commented Jan 13, 2024

Describe the bug:

I can't build an Android app on a macOS with ARM architecture using fyne-cross. I get a image platform (linux/amd64) does not match the expected platform (linux/arm64).

Perhaps fyne-cross is not passing the right --arch flag to podman, but there doesn't seem to be a way to inject that.

To Reproduce:

After setting up podman:

$ go run github.com/fyne-io/[email protected] android -app-id com.example.myapp
[i] Target: android/multiple
[i] Cleaning target directories...
WARNING: image platform (linux/amd64) does not match the expected platform (linux/arm64)
Error: statfs /private/var/folders/xt/gf42hf7x0wv8vstytl5989580000gn/T/ssh-hCLXh1SiTJ5Y/agent.39888: operation not supported
[✗] could not clean the "bin" dir /app/fyne-cross/bin/android: exit status 125
exit status 1

This is my system info:

$ uname -a
Darwin [REDACTED] 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64
$ go version
go version go1.20.4 darwin/arm64
@fortuna fortuna changed the title Can't build Android app on ARM macOS Can't build Android app on ARM macOS: image platform (linux/amd64) does not match the expected platform (linux/arm64) Jan 13, 2024
@Bluebugs
Copy link
Contributor

We currently do not support building for Android from an ARM* host. I don't know if it is still the case, but when we looked at it a year ago or so, there was no way to run Android NDK on an ARM* host.

I think to address your bug report, we should:

  • verify if that is still the case and look at what it take to fix it if it is possible.
  • replicate https://github.com/fyne-io/fyne-cross-images/ table that indicate which system are supported in a better way
  • improve fyne-cross error message

@andydotxyz
Copy link
Member

I'm sure this was working for me this week. Can you try the latest fyne-cross changes?

I think building from Linux arm is still not supported.

@Bluebugs
Copy link
Contributor

It would be interesting if you can investigate your setup and see how docker can run any AMD64 image on ARM64 as that what we currently provide for Android.

That being said, Google is now releasing an Android NDK compatible with ARM64. I have created an issue for this here: fyne-io/fyne-cross-images#42 .

@andydotxyz
Copy link
Member

Oh I'm sorry I missed that this was a fyne-cross bug.

Using the builtin Fyne tools with Android SDK is what works, fyne-cross does not, sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants