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

x/mobile/bind: panic on type struct #12368

Closed
diegostamigni opened this issue Aug 27, 2015 · 4 comments
Closed

x/mobile/bind: panic on type struct #12368

diegostamigni opened this issue Aug 27, 2015 · 4 comments

Comments

@diegostamigni
Copy link

gomobile is crashing while trying to bind github.com/diegostamigni/scriba/framework

osiris$ gomobile bind -target=android github.com/diegostamigni/scriba/framework
panic: unsupported named seqType: struct{StoragePath string; DatabaseUser string; DatabasePassword string; DatabaseName string; DatabaseAddress string; DatabasePort string; DatabaseProtocol string; DatabaseSocket string} / *types.Struct

goroutine 1 [running]:
golang.org/x/mobile/bind.seqType(0xa62538, 0xc824edbdd0, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/bind/seq.go:49 +0x10e3
golang.org/x/mobile/bind.(*goGen).genStruct(0xc826dcf730, 0xc8254dfcc0, 0xc825923a40)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/bind/gengo.go:184 +0xfd4
golang.org/x/mobile/bind.(*goGen).gen(0xc826dcf730, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/bind/gengo.go:425 +0x98b
golang.org/x/mobile/bind.GenGo(0xa62220, 0xc825f77fc0, 0xc820140540, 0xc82015a050, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/bind/bind.go:46 +0x195
main.(*binder).GenGo.func1(0xa62220, 0xc825f77fc0, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:168 +0x4d
main.writeFile(0xc8202b7180, 0x63, 0xc826dcf910, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:221 +0x35b
main.(*binder).GenGo(0xc824e3cab0, 0xc82012e550, 0x48, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:170 +0x414
main.goAndroidBind(0xc82013c000, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind_androidapp.go:31 +0x12d
main.runBind(0x921e80, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:99 +0x30c
main.main()
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/main.go:63 +0x495

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/Cellar/go/1.5/libexec/src/runtime/asm_amd64.s:1696 +0x1

go version: go1.5

@hyangah
Copy link
Contributor

hyangah commented Aug 27, 2015

The error was caused by
(d *DatabaseManager) GetEntitiesWithFilename(filename string) ([]Entity, error)

Slice types other than byte slice are currently not supported.

Error message needs to be improved. #11950

/cc @crawshaw

@hyangah hyangah added this to the Unreleased milestone Aug 27, 2015
@diegostamigni
Copy link
Author

Oka, make sense. Many thanks @hyangah

@diegostamigni
Copy link
Author

@hyangah I've removed the only slice that I have. It cames from the method that you said, but the problem is still there:

osiris$ gomobile bind -target=android github.com/diegostamigni/scriba/framework
panic: unsupported named seqType: struct{StoragePath string; DatabaseUser string; DatabasePassword string; DatabaseName string; DatabaseAddress string; DatabasePort string; DatabaseProtocol string; DatabaseSocket string} / *types.Struct

goroutine 1 [running]:
golang.org/x/mobile/bind.seqType(0xaa25e0, 0xc8284623c0, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/bind/seq.go:49 +0x10e3
golang.org/x/mobile/bind.(*goGen).genStruct(0xc828df7740, 0xc828402870, 0xc8280845f0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/bind/gengo.go:184 +0xfd4
golang.org/x/mobile/bind.(*goGen).gen(0xc828df7740, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/bind/gengo.go:425 +0x98b
golang.org/x/mobile/bind.GenGo(0xaa22c8, 0xc828415178, 0xc820156440, 0xc82016c2d0, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/bind/bind.go:46 +0x195
main.(*binder).GenGo.func1(0xaa22c8, 0xc828415178, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:168 +0x4d
main.writeFile(0xc820411500, 0x63, 0xc828df7920, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:221 +0x35b
main.(*binder).GenGo(0xc8283ec450, 0xc82013e690, 0x48, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:170 +0x414
main.goAndroidBind(0xc820150000, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind_androidapp.go:31 +0x12d
main.runBind(0x921e80, 0x0, 0x0)
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/bind.go:99 +0x30c
main.main()
    /Users/osiris/Sviluppo/go/src/golang.org/x/mobile/cmd/gomobile/main.go:63 +0x495

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/local/Cellar/go/1.5/libexec/src/runtime/asm_amd64.s:1696 +0x1
osiris$ 

go version: go1.5

@diegostamigni diegostamigni reopened this Aug 28, 2015
@diegostamigni
Copy link
Author

Ok, finally I figure it out what's going wrong with the bindings:

@mikioh mikioh changed the title gomobile bind panic on type struct x/mobile/bind: panic on type struct Aug 29, 2015
@golang golang locked and limited conversation to collaborators Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants