Code Monkey home page Code Monkey logo

Comments (7)

xlab avatar xlab commented on August 18, 2024 1

Yeah that's pretty sad. The known workaround is to get the previous version of the sdk tools, see NativeScript/nativescript-cli#2583 (comment)

This was the latest March release of SDK tools that removed the android utility without providing a fallback. https://developer.android.com/studio/releases/sdk-tools.html

from android-go.

dudochkin-victor avatar dudochkin-victor commented on August 18, 2024 1

CFLAGS=-D__ANDROID_API__=$API worked for me. But there are other problem.

make
mkdir -p android/jni/lib
CC="/mnt/data/GO/src/github.com/golang-ui/nuklear/cmd/nk-android/toolchain/bin/arm-linux-androideabi-gcc"
CXX="/mnt/data/GO/src/github.com/golang-ui/nuklear/cmd/nk-android/toolchain/bin/arm-linux-androideabi-g++"
CGO_CFLAGS="-march=armv7-a -std=c99 -D__ANDROID_API__=21"
GOOS=android
GOARCH=arm
GOARM=7
CGO_ENABLED=1
go build -tags gles3 -buildmode=c-shared -o android/jni/lib/libnkactivity.so

github.com/xlab/android-go/android
In file included from ../../../../xlab/android-go/android/types.go:25:0:
/mnt/data/GO/src/github.com/golang-ui/nuklear/cmd/nk-android/toolchain/sysroot/usr/include/android/tts.h:99:8: error: expected identifier or '(' before string constant
extern "C" android_tts_engine_t *getTtsEngine();
^
make: *** [Makefile:15: build] Error 2

I fixed it by removing any "#include <android/tts.h>" lines.
So the libnkactivity.so compiled.

from android-go.

xlab avatar xlab commented on August 18, 2024

@udhos
https://github.com/xlab/android-go/tree/master/cmd/android-project

Example:
https://github.com/xlab/android-go/blob/master/example/android/Makefile#L13

from android-go.

longtq6195-seta-international avatar longtq6195-seta-international commented on August 18, 2024

longtran@longtran:~/go/src/github.com/xlab/android-go/example-egl$ make
mkdir -p android/jni/lib
CC="/home/longtran/go/src/github.com/xlab/android-go/example-egl/toolchain/bin/arm-linux-androideabi-gcc"
CXX="/home/longtran/go/src/github.com/xlab/android-go/example-egl/toolchain/bin/arm-linux-androideabi-g++"
CGO_CFLAGS="-march=armv7-a"
GOOS=android
GOARCH=arm
GOARM=7
CGO_ENABLED=1
go build -buildmode=c-shared -o android/jni/lib/libexample.so

runtime/cgo

/tmp/go-build017993175/runtime/cgo/_obj/gcc_android.o:gcc_android.c:function fatalf: error: undefined reference to 'stderr'
/tmp/go-build017993175/runtime/cgo/_obj/gcc_libinit.o:gcc_libinit.c:function x_cgo_sys_thread_create: error: undefined reference to 'stderr'
/tmp/go-build017993175/runtime/cgo/_obj/gcc_util.o:gcc_util.c:function x_cgo_thread_start: error: undefined reference to 'stderr'
collect2: error: ld returned 1 exit status
Makefile:13: recipe for target 'build' failed
make: *** [build] Error 2

from android-go.

xlab avatar xlab commented on August 18, 2024

@longtq6195-seta-international unfortunately I can't reproduce, tried both Go 1.8.1 and 1.9beta2.
I'm using OS X, so this may be different from your setup.
Probably a bug in Go compiler on this platform

from android-go.

tirithen avatar tirithen commented on August 18, 2024

I'm getting similar errors:

➜  example git:(master) ✗ make
mkdir -p android/jni/lib
CC="/home/tirithen/.go/src/github.com/xlab/android-go/example/toolchain/bin/arm-linux-androideabi-gcc" \
CXX="/home/tirithen/.go/src/github.com/xlab/android-go/example/toolchain/bin/arm-linux-androideabi-g++" \
CGO_CFLAGS="-march=armv7-a" \
GOOS=android \
GOARCH=arm \
GOARM=7 \
CGO_ENABLED=1 \
go build -buildmode=c-shared -o android/jni/lib/libexample.so
# runtime/cgo
/tmp/go-build521705144/runtime/cgo/_obj/gcc_android.o:gcc_android.c:function fatalf: error: undefined reference to 'stderr'
/tmp/go-build521705144/runtime/cgo/_obj/gcc_libinit.o:gcc_libinit.c:function x_cgo_sys_thread_create: error: undefined reference to 'stderr'
/tmp/go-build521705144/runtime/cgo/_obj/gcc_util.o:gcc_util.c:function x_cgo_thread_start: error: undefined reference to 'stderr'
collect2: error: ld returned 1 exit status
make: *** [Makefile:14: build] Fel 2

Go version

➜  example git:(master) ✗ go version
go version go1.8.3 linux/amd64

Oh, and my machine is running Arch Linux with the Android packages installed through AUR

from android-go.

kitech avatar kitech commented on August 18, 2024

try this, android/ndk#445 (comment)

from android-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.