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: gobind Gradle plugin not working with Android Studio 3.0 #23307
Comments
I have the same problem. There is a workaround ? |
Same problem here. My current workaround is to build the .aar file manually with You can test it with bind/hello example. Delete the "hello" folder with its gradle file from the android project first, then build the hello.aar manually, in the original location of the hello.go package, import the .aar into the Android Studio project, and make the project dependent on the newly added module. |
After a bunch of blind poking and prodding in GobindPlugin.groovy, I have something that works. I don't know if it's the right way to fix this bug, but I am able to sync and build my project again. Specifically, I moved the 'clean task':
from the GobindPlugin.apply method to BindTask.run method. To anyone who is more knowledgeable about Gradle plugins, is this is a reasonable way to fix the issue? Here's a diff for reference:
|
Any updates? |
Change https://golang.org/cl/112455 mentions this issue: |
The CL should fix the issue. Note that only gradle sync fails; running a gomobile project from Android Studio does work. |
…sync Suggestion from golang/go#23307 (comment) I've manually verified in Android Studio that removing the clean task does fix the issue reported in golang/go#25290. Fixes golang/go#25290. Fixes golang/go#23307. Change-Id: Ic1a8c240fc8e4c4aaf59977fd559dd221ff605b1 Reviewed-on: https://go-review.googlesource.com/112455 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
…sync Suggestion from golang/go#23307 (comment) I've manually verified in Android Studio that removing the clean task does fix the issue reported in golang/go#25290. Fixes golang/go#25290. Fixes golang/go#23307. Change-Id: Ic1a8c240fc8e4c4aaf59977fd559dd221ff605b1 Reviewed-on: https://go-review.googlesource.com/112455 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go1.8.1 linux/amd64
Does this issue reproduce with the latest release?
Don't know, this is the latest release available in Debian Stretch (backports).
What operating system and processor architecture are you using (
go env
)?linux/amd64
(Debian Stretch)What did you do?
I tried to run the mobile/example/bind/android example with AndroidStudio 3.0.1, which uses Gradle 4.1 and version 3.0.1 of the Android Gradle build plugin.
What did you expect to see?
A successful Gradle project sync.
What did you see instead?
Gradle project sync failed.
Even if I create the
hello.aar
file manually via command line usinggomobile bind
and copy it to the above location, it get's deleted again as soon as I run the Gradle sync in Android Studio.The text was updated successfully, but these errors were encountered: