fyne-io / fyne

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

App Crash on IOS Simulator #4828

Open BHLabsLtd opened 6 months ago

BHLabsLtd commented 6 months 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 6 months 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 6 months 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 6 months 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 5 months 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 5 months ago

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

changkun commented 5 months ago

Just tried and I can reproduce the issue.

andydotxyz commented 4 months ago

I have managed to track this down to the 17.4 simulator, where 17.0 does not have the problem at all.

It would seem to relate to the OpenGL ES rendering somehow - actually asking the triangle strip to be drawn is what triggers the crash on this simulator!

andydotxyz commented 4 months ago

Unfortunately 17.5 also has this problem, though it is quite mysterious