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: java custom package name handling (-javapkg flag) is broken #16262

Closed
funwun opened this issue Jul 4, 2016 · 0 comments
Closed

Comments

@funwun
Copy link

funwun commented Jul 4, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6.2 linux/amd64
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/go/"
    GORACE=""
    GOROOT="/usr/local/go"
    GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
  3. What did you do?
    build SDK applications for android
  4. What did you expect to see?
    no error.
  5. What did you see instead?
    java.lang.UnsatisfiedLinkError: Native method not found: go.Universe.init:()V

I build a aar file for android app with multiple go package:
gomobile bind -v -o test.sdk.aar -javapkg test.sdk test.sdk/info test.sdk/db

bind is ok, and I get a aar file, but run in andorid, I get the error:
java.lang.UnsatisfiedLinkError: Native method not found: go.Universe.init:()V

If I REMOVE -javapkg test.sdk parameters, everything is OK.

How can I use the special java package name? is possible?

@hyangah hyangah changed the title java.lang.UnsatisfiedLinkError: Native method not found: go.Universe.init:()V x/mobile/bind: java custom package name handling (-javapkg flag) is broken Jul 7, 2016
@hyangah hyangah added this to the Unreleased milestone Jul 7, 2016
@golang golang locked and limited conversation to collaborators Jul 7, 2017
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
The change from using strings to objects for passing errors across
the language barrier broke the custom java package mode of gombile
bind. Fix it and add a runtime test to make sure it won't happen
again.

Fixes golang/go#16262

Change-Id: Ia7f8afb79556798056f0755758052190081a2dbb
Reviewed-on: https://go-review.googlesource.com/24800
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
The change from using strings to objects for passing errors across
the language barrier broke the custom java package mode of gombile
bind. Fix it and add a runtime test to make sure it won't happen
again.

Fixes golang/go#16262

Change-Id: Ia7f8afb79556798056f0755758052190081a2dbb
Reviewed-on: https://go-review.googlesource.com/24800
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
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