flutter' app crash met with gomobile package .aar

136 views
Skip to first unread message

jlp hu

unread,
Mar 21, 2018, 8:37:11 AM3/21/18
to golang-nuts

flutter' app crash met with gomobile package .aar

  1. I follow the guidence https://flutter.io/platform-channels/ ... It works; I can see the result in Simulator.

  2. I write a simple code in Golang, Gomobile bind -target=android, get .aar file, put into libs, the app stopped when the call happened. The code is very simple:

package bond

import (

)

func FirstCall() int{
return 20180311
}

func SecondCall() string{
return "20180311"
}

func ThirdCall() {
}

type Counter struct {
Value int
}

func (c *Counter) Inc() { c.Value++ }

func NewCounter() *Counter { return &Counter{ 5 } }
3) I create app with Android Studio, put the .aar file in, and call, it gets the right return.

final String stext=Bond.secondCall();
4) So the problem is, there are 2 bridges here; each of them work, but put together, it crashes.

Anybody could give me a solution? Is the problem in Flutter or Gomobile?

Elias Naur

unread,
Mar 21, 2018, 5:06:29 PM3/21/18
to golang-nuts
I have no experience with that combination. Is there a stack trace or error message along with the crash?

Ged Wed

unread,
Mar 24, 2018, 5:24:41 AM3/24/18
to golang-nuts
do you have a git repo we can look at.

I have done this before with flutter and golang.
Reply all
Reply to author
Forward
0 new messages