simple gomobile bind (for android) test fails

132 views
Skip to first unread message

Matt Hawkins

unread,
Apr 6, 2015, 5:55:37 PM4/6/15
to golan...@googlegroups.com
Hey guys,
I'm trying to test the building shared objects for android (and eventually static lib for ios) via gomobile.  Running on tip, I prepared gomobile with 'gomobile init' and all seems well.

I then have a simple test package i'm playing around with that has a few simple export functions.  Here is my code:

package echo

func Echo(s string) (string, error) {
return s + " from go!", nil
}


Then I run
gomobile bind -x

Which produces a linking error
/Users/mhawkins/Library/go/pkg/gomobile/android-ndk-r10d/arm/bin/toolexec /Users/mhawkins/src/go/pkg/tool/darwin_amd64/5l -o /var/folders/9s/_chc2vkd5l3d7251t9sflgk5759k1h/T/gomobile-bind-work-343039510/android/src/main/jniLibs/armeabi-v7a/libgojni.so -L $WORK -L /Users/mhawkins/Library/go/pkg/android_arm -extld=/Users/mhawkins/Library/go/pkg/gomobile/android-ndk-r10d/arm/bin/arm-linux-androideabi-gcc -shared $WORK/command-line-arguments.a
# command-line-arguments
_rt0_arm_android_lib.ptr: _rt0_arm_android_lib: not defined
_rt0_arm_android_lib.ptr: undefined: _rt0_arm_android_lib
exit status 2
rm -r -f "$WORK"
gomobile: exit status 2


Any idea how to fix this?

Thanks!
Matt

Hyang-Ah Hana Kim

unread,
Apr 6, 2015, 6:24:35 PM4/6/15
to Matt Hawkins, golan...@googlegroups.com
Yes, I observed the same. Syncin'g the go main repo to sometime 2 weeks ago made it continue to work.  I filed a bug: https://github.com/golang/go/issues/10358

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
__

David Crawshaw

unread,
Apr 6, 2015, 7:04:14 PM4/6/15
to Hyang-Ah Hana Kim, Matt Hawkins, golang-nuts
I just submitted cl/8510, which I believe fixes this. Please let me
know if you have any trouble syncing past ede863c6734a.

Matt Hawkins

unread,
Apr 7, 2015, 11:11:02 AM4/7/15
to golan...@googlegroups.com, hya...@gmail.com, hawk...@gmail.com
Yup, the fix works great!  Thanks!!
Reply all
Reply to author
Forward
0 new messages