Comments (7)
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.
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.
@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.
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.
@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.
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.
try this, android/ndk#445 (comment)
from android-go.
Related Issues (20)
- Update examples to match new build system HOT 4
- error callfn HOT 4
- 404 to example in readme
- Error stdlib.h trying to build example directory HOT 2
- Documentation ?
- example-egl build fails
- Notifications using other api HOT 1
- Exposing golang direct to Flutter HOT 3
- Example link with the info how to set up environment for Android Demo App is broken
- android project update is not working on debian
- gles2 runtime error: cgo argument has Go pointer to Go pointer HOT 1
- EGL bug. Opengl ES version Mismatch HOT 5
- internal/callfn error when running main.go file HOT 6
- Error "Sorry com.go_android.minimal stopped"
- llvm/prebuilt/darwin-x86_64/bin/clang: No such file or directory HOT 6
- Binding to Fyne UI framework HOT 2
- Take photo
- Pointer type uint32 is too small for 64bit compilation (*_Ctype_ulong) HOT 1
- Egl Exemple not compilling HOT 2
- App: Add getting asset directory contents HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-go.