Closed pieterclaerhout closed 6 years ago
I believe I am having the same problem. I've updated the env.go file but how do you rebuild gomobile at this point? I'm working on win10.
Running the gomobile init -ndk ...
command should do the rebuild.
Thanks.
Given this I tried the following and pretty much get the same result as before. So, maybe I'm still doing something wrong or my problem is different. Does the following command look correct? I've trimmed the middle of its output. Thanks, Will
powershell> gomobile init -ndk C:\Users\auld\AppData\Local\Android\sdk1\ndk-bundle -v
runtime/cgo
C:\Users\auld\AppData\Local\Android\sdk1\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: error: cannot open crtbegin_dynamic.o: No such file or directory C:\Users\auld\AppData\Local\Android\sdk1\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: error: cannot open crtend_android.o: No such file or directory ... C:\Users\auld\AppData\Local\Temp\go-build552291650\b081_x010.o:gcc_util.c:function x_cgo_thread_start: error: undefined reference to '__sF' clang.exe: error: linker command failed with exit code 1 (use -v to see invocation) C:\home\auld\godev\bin\gomobile.exe: go install -gcflags=-shared -ldflags=-shared -pkgdir=C:\home\auld\godev\pkg\gomobile/pkg_android_arm -v std failed: exit status 2
From what I can see, your problem seems to be different.
In your case it seems that the actual compilation of the Android native stuff fails:
C:\Users\auld\AppData\Local\Temp\go-build552291650\b081_x010.o:gcc_util.c:function x_cgo_thread_start: error: undefined reference to '__sF'
clang.exe: error: linker command failed with exit code 1 (use -v to see invocation)
OK, well thanks for your help, I'll keep digging.
OK here is what works for me (I'm on Win10):
I believe this is fixed in the latest gomobile version. Can you confirm?
Yes, it seems to be working fine now.
Then I rebuilt / bind my go lib and built my android app and all works fine
Thanks, Wil
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
I'm trying to install gomobile, but the init step fails.
The Android SDK version which I have installed is
18.0.4951716 rc2
.What did you expect to see?
I expected to see no error message at all.
What did you see instead?
From what I can see, the arguments specified to run the Android NDK
make_standalone_toolchain.py
are incorrect. When making the toolchain for eitherarm
orx86
requires a minimum api level of16
, not15
. This can easily be fixed by updating the following file:There, the NDK config should be updated from:
to
After patching this file manually, rebuilding the
gomobile
command, I was able to succesfully runbin/gomobile init -ndk /Library/Android/sdk/ndk-bundle
.