fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
23.88k stars 1.34k forks source link

App Crash on IOS Simulator #4828

Open BHLabsLtd opened 1 month ago

BHLabsLtd commented 1 month ago

Checklist

Describe the bug

When running any fyne app in IOS / Android Simulator the app immediately closes after a quick black screen.

Fyne hello world code in main.go also testing with base64 app from app page.

the console log from running the app. Not sure what it means..

app error.txt

How to reproduce

git clone https://github.com/able8/base64-encoder-decoder

Manually update go.mod to version v2.4.5

go mod tody go build ./base64-encoder-decoder go build and app works fine on Mac OS.

now build for IOS simulator

fyne package fyne package -os iossimulator -appID com.github.able8.base64-encoder-decoder

go mobile gomobile build -v -target=ios -bundleid com.github.able8.base64-encoder-decoder

tried xcrun instead of dragging ... xcrun simctl install booted Base64-Encoder-Decoder.app

same issue with android simulator fyne package -os android -appID com.github.able8.base64-encoder-decoder

tried adb instead of dragging... adb install Base64-Encoder-Decoder.apk

Screenshots

No response

Example code

package main

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

func main() {
    a := app.New()
    w := a.NewWindow("Hello")

    hello := widget.NewLabel("Hello Fyne!")
    w.SetContent(container.NewVBox(
        hello,
        widget.NewButton("Hi!", func() {
            hello.SetText("Welcome :)")
        }),
    ))

    w.ShowAndRun()
}

Fyne version

2.4.5

Go compiler version

1.22.2

Operating system and version

Sonoma 14.4.1

Additional Information

Testing on Apple M3 Pro Sonoma 14.4.1 Go 1.22.2 gcc clang 15.0.0 Fyne 2.4.5 (app and code)

andydotxyz commented 1 month ago

There is a known issue with the latest iossimulator that we are working on.

However there is no known issue with the Android emulator. Please provide the crash log for running Fyne's demo app on your emulator.

BHLabsLtd commented 1 month ago

Hi @andydotxyz I've tested the exact same as above on an Intel I9 Mac and it runs fine with the latest iossimulator. Do you have an ETA on when the issue will be fixed or anywhere i can look to help out?

Apologies I've just retested the demo app in Android and it is working. so it's just the IOS Simulator that's failing.

andydotxyz commented 1 month ago

Do you have an ETA on when the issue will be fixed or anywhere i can look to help out?

No, we can't really estimate such things until we understand them. The issue appears to be with the latest XCode tools on the Apple Silicon which causes no end of problems. Probably some mismatch on binaries or boot sequence but unless you can track down some error logged that we've not found it's basically trial and error or speaking to an Apple engineer...

Maybe the gomobile project has encountered and solved this already?

RiRa12621 commented 1 month ago

Seeing the same.

code:

package main

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

func main() {
    a := app.New()
    w := a.NewWindow("Hello World")

    w.SetContent(widget.NewLabel("Hello World!"))
    w.ShowAndRun()
}

build and run:

fyne package -os iossimulator -appID com.example.myapp -icon resources/_gen/images/ios_store_icon.png && xcrun simctl install booted fyniere.app

App installs fine, if I tap it, it opens and insta-crashes.

Crash report attached:

main-2024-05-23-232233.ips.zip

andydotxyz commented 1 month ago

Adding a bounty of £250 as we need to get this figured out...

changkun commented 1 month ago

Just tried and I can reproduce the issue.