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 runtime error with fyne.dialog #1896

Closed
lMaxMadl opened this issue Feb 2, 2021 · 5 comments
Closed

android runtime error with fyne.dialog #1896

lMaxMadl opened this issue Feb 2, 2021 · 5 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working OS:Android Tickets affecting only Android devices

Comments

@lMaxMadl
Copy link

lMaxMadl commented Feb 2, 2021

hey
below code
dialog.ShowInformation("s", "sd", w)
or any dialog. if add to main.go file shows error and stop it if project lunch on android device
please let me know it's bug or must use another way to show dialog

@andydotxyz
Copy link
Member

I don't understand what the error is that you are reporting.
Can you share the compile error?
Or runtime crash?

@andydotxyz andydotxyz added the question A question has been asked label Feb 2, 2021
@lMaxMadl
Copy link
Author

lMaxMadl commented Feb 4, 2021

I don't understand what the error is that you are reporting.
Can you share the compile error?
Or runtime crash?

hey man
i Explain error better
fyne.dialog is really OK with windows platform i tested
but it have error with android device when i test there
for example

package main

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

func main() {
	a := app.New()
	w := a.NewWindow("Hello")
	hello := widget.NewLabel("fyne")
	dialog.ShowInformation("s", "sd", w)
	w.SetContent(container.NewVBox(
		hello,
		widget.NewButton("Hi!", func() {
			hello.SetText("sd")
		}),
	))

	w.ShowAndRun()
}

shows error when lunch on android device show error "app repeatly closing"
but is ok on windows
and i meant if it's bug on fyne or must use another way to show dialog on android please let me know
thanks

@andydotxyz
Copy link
Member

Please share the error from adb logcat | grep Fyne - it will show why there is an error.

@andydotxyz andydotxyz changed the title android compile show error with fyne.dialog android runtime error with fyne.dialog Feb 7, 2021
@andydotxyz andydotxyz added the OS:Android Tickets affecting only Android devices label Feb 7, 2021
@andydotxyz
Copy link
Member

I was able to capture the output:

02-07 12:18:35.144 27750  8908 W io.fyne.hello: 0xebadde09 skipped times: 0
02-07 12:18:35.146 27750     0 E Go      : panic: runtime error: invalid memory address or nil pointer dereference
02-07 12:18:35.146 27750     0 E Go      : [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7644f69b4c]
02-07 12:18:35.146 27750     0 E Go      : 
02-07 12:18:35.146 27750  8903 E Fyne    : panic: runtime error: invalid memory address or nil pointer dereference
02-07 12:18:35.146 27750     0 E Go      : goroutine 11 [running]:
02-07 12:18:35.146 27750  8903 E Fyne    : [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7644f69b4c]
02-07 12:18:35.146 27750     0 E Go      : fyne.io/fyne/v2/internal/driver/gomobile.hideVirtualKeyboard()
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/src/fyne.io/fyne/v2/internal/driver/gomobile/keyboard.go:17 +0x4c
02-07 12:18:35.146 27750     0 E Go      : fyne.io/fyne/v2/internal/driver/gomobile.(*mobileCanvas).handleKeyboard(0x400031e000, 0x0, 0x0)
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/src/fyne.io/fyne/v2/internal/driver/gomobile/canvas.go:242 +0x68
02-07 12:18:35.146 27750     0 E Go      : fyne.io/fyne/v2/internal/driver/gomobile.(*mobileCanvas).overlayChanged(0x400031e000)
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/src/fyne.io/fyne/v2/internal/driver/gomobile/canvas.go:280 +0x2c
02-07 12:18:35.146 27750     0 E Go      : fyne.io/fyne/v2/internal.(*OverlayStack).Add(0x4000058a20, 0x7645098b60, 0x40004ba000)
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/src/fyne.io/fyne/v2/internal/overlay_stack.go:47 +0x1dc
02-07 12:18:35.146 27750     0 E Go      : fyne.io/fyne/v2/widget.(*PopUp).Show(0x40004ba000)
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/src/fyne.io/fyne/v2/widget/popup.go:63 +0x90
02-07 12:18:35.146 27750     0 E Go      : fyne.io/fyne/v2/dialog.(*dialog).Show(0x40001c4280)
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/src/fyne.io/fyne/v2/dialog/base.go:106 +0x3c
02-07 12:18:35.146 27750     0 E Go      : fyne.io/fyne/v2/dialog.ShowInformation(0x7644f8cb28, 0x1, 0x7644f8cc8c, 0x2, 0x7645099bc0, 0x4000058a80)
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/src/fyne.io/fyne/v2/dialog/information.go:30 +0x5c
02-07 12:18:35.146 27750     0 E Go      : main.main()
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/src/fyne.io/fyne/v2/cmd/hello/main.go:14 +0xd0
02-07 12:18:35.146 27750     0 E Go      : github.com/fyne-io/mobile/app/internal/callfn.CallFn(0x7644f87180)
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/pkg/mod/github.com/fyne-io/mobile@v0.1.2/app/internal/callfn/callfn_arm64.s:10 +0x1c
02-07 12:18:35.146 27750     0 E Go      : created by github.com/fyne-io/mobile/app.callMain
02-07 12:18:35.146 27750     0 E Go      : 	/Users/andy/Go/pkg/mod/github.com/fyne-io/mobile@v0.1.2/app/android.go:114 +0x2bc

@andydotxyz andydotxyz added blocker Items that would block a forthcoming release bug Something isn't working and removed question A question has been asked labels Feb 7, 2021
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Feb 7, 2021
@andydotxyz
Copy link
Member

This is fixed on develop, and will be in 2.0.1 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working OS:Android Tickets affecting only Android devices
Projects
None yet
Development

No branches or pull requests

2 participants