conejoninja / MyGoApplication

Example application using Gomobile bind
18 stars 4 forks source link

Is gradle supposed to build the aar file? #2

Closed willauld closed 6 years ago

willauld commented 6 years ago

I was wondering if gradle is supposed to build the aar file or if you explicitly run gomobile?

I have the project running and then deleted the aar file to see it being rebuild but only got errors. Rebuilt the aar file by hand with gomobile and all it good again.

Thanks, Will

conejoninja commented 6 years ago

I explicitly run gomobile since my Android application is not in my $GOPATH, and "mygolibrary" is. I use something like (from the mygolibrary folder in your $GOPATH). Also, I'm not that good with gradle and you (probably) don't need to build mygolibrary each time

gomobile bind -target android -o mygolibrary.aar -v . && cp mygoapplication.aar /path/to/MyGoApplication/mygolibrary/mygolibrary.aar
willauld commented 6 years ago

Thanks that is helpful to know :-)