You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Wrote a small go file which exported 1 function called Justtesting(in string) string ...
Ran gomobile build -x -v -target=android com.alex/mobilelib
Went to android studio and did the following:
File > New > New Module > Import .JAR or .AAR package
File > Project Structure > app -> Dependencies -> Add Module Dependency
Add import: import mobilelib.Mobilelib;
Mobilelib.Justtesting worked after building and running.
I changed the source code of the go file and added a different exported function Getuser(a string, b string) string ...
When I tried to update the file by reimporting, Android studio stops me to say that a library with the same name already exists. So I open the directory instead and update the .aar file manually.
I notice there is a gradle plugin that seems like it might be what I'm looking for but I'm not sure how to use the build script. Android studio creates a build.grade for my module
I tried replacing this with the following from hello/build.gradle
plugins {
id "org.golang.mobile.bind" version "0.2.8"
}
gobind {
/* The Go package path; must be under one of the GOPATH elements or
a relative to the current directory (e.g. ../../hello) */
// pkg = "golang.org/x/mobile/example/bind/hello"
pkg = "com.alex/mobilelib"
/* GOPATH where the Go package is; check `go env` */
// GOPATH = "/YOUR/GOPATH"
/* Absolute path to the go binary */
// GO = "/PATH/TO/GO"
/* Optionally, set the absolute path to the gomobile binary if the
/* gomobile binary is not located in the GOPATH's bin directory. */
// GOMOBILE = "/PATH/TO/GOMOBILE"
}
What did you expect to see?
Successful build
What did you see instead?
:mobilelib:gobind FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mobilelib:gobind'.
> Cannot get property 'classpath' on null object
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.427 secs
The text was updated successfully, but these errors were encountered:
ALTree
changed the title
Best way to import and update .aar in Android Studio
x/mobile: best way to import and update .aar in Android Studio
Feb 6, 2017
is this a bug report or a question about using gomobile with Android Studio?
If it's the latter, you should ask it somewhere else, since we don't use the issue tracker for questions (see the Questions wiki page; it has a list of good places for asking questions).
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.7.5 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
Wrote a small go file which exported 1 function called Justtesting(in string) string ...
Ran
gomobile build -x -v -target=android com.alex/mobilelib
Went to android studio and did the following:
File > New > New Module > Import .JAR or .AAR package
File > Project Structure > app -> Dependencies -> Add Module Dependency
Add import: import mobilelib.Mobilelib;
Mobilelib.Justtesting worked after building and running.
I changed the source code of the go file and added a different exported function
Getuser(a string, b string) string ...
When I tried to update the file by reimporting, Android studio stops me to say that a library with the same name already exists. So I open the directory instead and update the .aar file manually.
I notice there is a gradle plugin that seems like it might be what I'm looking for but I'm not sure how to use the build script. Android studio creates a build.grade for my module
I tried replacing this with the following from hello/build.gradle
What did you expect to see?
Successful build
What did you see instead?
The text was updated successfully, but these errors were encountered: