Can't build streamer tutorial for android on mac - android

Can't build streamer tutorial_3 for android on mac
I,ve got all environment variables needed.
My eclipse can't to resolve some symbols, but to some of them i can get by pushing F3. It's very strange for me.
Here is the command line output:
23:04:06 **** Build of configuration Default for project Tutorial3 ****
/Users/antonivanuskin/android-develop/android-ndk-r10/ndk-build all
GStreamer : [GEN] => gst-build-armeabi/gstreamer_android.c
GStreamer : [COMPILE] => gst-build-armeabi/gstreamer_android.c
GStreamer : [LINK] => gst-build-armeabi/libgstreamer_android.so
lto1: fatal error: bytecode stream generated with LTO version 2.2 instead of the expected 3.0
compilation terminated.
lto-wrapper: /Users/antonivanuskin/android-develop/android-ndk-r10/toolchains/arm- linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc returned 1 exit status
/Users/antonivanuskin/android-develop/android-ndk-r10/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld.gold: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [buildsharedlibrary_armeabi] Error 1
23:04:10 Build Finished (took 3s.740ms)*
I use ndk-10r and gst-1.4.0.
I know that there is no interfaces/xoverlay in new streamer.
EDIT
I've built ok, but steel got underlines of many glib-types and GST-macross. Here is a screenshot:
what is interesting that i have no underlined headers, for example: i've include pthread.h but have got underlined pthread_t and phtread_key_t....
i think that i have not install some general libraries on my mac, something like libc or what ever...may it couse this problem? The problem is that i can't run my app from eclipse. and for more: i use DS-5 CE IDE

This is most likely because we build the android 1.4.x cerbero packages with the r9d NDK.
You might want to use the r9d NDK until we provide binaries built with a more recent NDK (started some builds to see if everything goes through fine).

Related

Trying to get BGFX to build for Android

We're trying to get BGFX to build for Android, following the guide here: https://github.com/Nodrev/bgfx-android-activity as recommended on the BGFX main site.
However, this repository was last updated 3+ years ago, and since then there have been major revisions to the Android NDK structure, meaning all of the library paths are all wrong. We've managed to make some progress, but keep getting stuck on the same error.
What we've tried so far:
Using various NDK versions from 17 to 25. NDK 21 seems to be the one before the big change in NDK structure but we consistently get an error at some point during the build with each NDK: 'alloca.h' file not found
Using NDK 25, we got various other errors due to incorrect paths, managed to get past those, but this just led us back to the above error.
Posting a message on the BGFX discussion board, no response.
We found a message here that appears to describe the problem we're having but the second solution does not work, with error:
error: use of undeclared identifier 'GL_PARAMETER_BUFFER_ARB' ...GL_CHECK(glBindBuffer(GL_PARAMETER_BUFFER_ARB, 0) );
and the first solution doesn't contain enough information to try to replicate it.
The main issue we're having is that it seems there is a variable sysroot which tells the build process where to look for headers and libraries, this points to --sysroot=$(ANDROID_NDK_ROOT)/platforms/android-32/arch-arm in the build script, which does not exist. Setting it to a platform that does exist, e.g. --sysroot=$(ANDROID_SDK_ROOT)/platforms/android-32/ got us as far as the alloc.h error above.
alloca.h is found in \AppData\Local\Android\Sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include so we tried setting sysroot to $(ANDROID_NDK_X86)/sysroot/usr/
which led to the error:
\AppData\Local\Android\Sdk\ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64/sysroot/usr//include/linux/types.h:21:10: fatal error: 'asm/types.h' file not found
asm/types.h is found in a few places:
ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\aarch64-linux-android\asm ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\arm-linux-androideabi\asm ndk\25.1.8937393\toolchains\llvm\prebuilt\windows-x86_64\sysroot\usr\include\i686-linux-android\asm
but changing sysroot to point to e.g. --sysroot=$(ANDROID_NDK_ARM)/sysroot/usr/include/arm-linux-androidabi gets us back to the alloca.h error again.
This is the error in full:
process_begin: CreateProcess(NULL, uname, ...) failed.
makefile:6: pipe: No error
C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe -R -C .build/projects/gmake-android-arm config=debug
make[1]: Entering directory '.../bgfx/.build/projects/gmake-android-arm'
"==== Building bx (debug) ===="
allocator.cpp
In file included from ../../../../bx/src/allocator.cpp:6:
In file included from ../../../../bx/include/bx/allocator.h:9:
../../../../bx/include/bx/bx.h:9:10: fatal error: 'alloca.h' file not found
#include <alloca.h> // alloca
^~~~~~~~~~
1 error generated.
make[2]: *** [bx.make:441: ../../android-arm/obj/Debug/bx/bx/src/allocator.o] Error 1
make[1]: *** [Makefile:17: bx] Error 2
make[1]: Leaving directory '.../bgfx/.build/projects/gmake-android-arm'
make: *** [makefile:69: android-arm-debug] Error 2
We've run out of ideas at this point, would greatly appreciate some help!

Cannot compile bazel needed for tensorflow-android

I'm trying to explore the tensorflow android demo. I want to adapt the app using android studio.
However when I simply follow the instructions I get compilation errors no matter what I do:
Trying to compile tensorflow using bazel and NDK r12b:
$bazel build -c opt //tensorflow/examples/android:tensorflow_demo
ERROR: /home/myUser/libs/tensorflow_android/WORKSPACE:3:1: //external:io_bazel_rules_closure: no such attribute 'urls' in 'http_archive' rule.
ERROR: /home/myUser/libs/tensorflow_android/WORKSPACE:3:1: //external:io_bazel_rules_closure: missing value for mandatory attribute 'url' in 'http_archive' rule.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '#io_bazel_rules_closure//closure': error loading package 'external': Could not load //external package.
INFO: Elapsed time: 0.129s
Trying to compile a newer version of bazel following this advice:
$bazel version
Build label: 0.2.3-jdk7 // This is my current version of bazel
via apt-get:
$sudo apt-get upgrade bazel
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
E: Unable to locate package bazel
from source (tried bazel-0.4.2 and bazel-0.5.0):
$./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: ./compile.sh compile /path/to/bazel
🍃 Building Bazel from scratch
ERROR: JDK version (1.7) is lower than 1.8, please set $JAVA_HOME.
or
$bazel build //src:bazel
ERROR: /home/myUser/libs/bazel/bazel-0.4.2/tools/build_rules/genproto.bzl:45:16: Traceback (most recent call last):
File "/home/myUser/libs/bazel/bazel-0.4.2/tools/build_rules/genproto.bzl", line 42
rule(gensrcjar_impl, attrs = {"src": at..."), <2 more arguments>), "_proto_compiler": attr.label(default = Label("//third_party/p..."), <4 more arguments>), "_jar": attr.label(default = Label("#bazel_tools//t..."), <4 more arguments>), "_jdk": attr.label(default = Label("#bazel_tools//t..."), ...)}, ..."})
File "/home/myUser/libs/bazel/bazel-0.4.2/tools/build_rules/genproto.bzl", line 45, in rule
attr.label(allow_files = proto_filetype, sing...)
allow_files should be a boolean or a filetype object.
ERROR: /home/myUser/libs/bazel/bazel-0.4.2/src/BUILD:130:1: error loading package 'src/main/protobuf': Extension file 'tools/build_rules/genproto.bzl' has errors and referenced by '//src:embedded_tools'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 0.251s
switching aroung java-versions to see whether the bazel compiling issues come from there:
$sudo update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1074 auto mode
1 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
* 2 /usr/lib/jvm/java-7-oracle/jre/bin/java 1072 manual mode
3 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1069 manual mode
4 /usr/lib/jvm/java-8-oracle/jre/bin/java 1074 manual mode
No luck so far :-/. Has anyone successfully compiled tensorflow for android from source?
What version of Tensorflow, NDK, bazel, java are required / compatible with each other? Do I really need bazel? (never worked with it anyway) Can't I just compile the android demo in android-studio like any other app?
I'm using Ubuntu 14.04, Cuda8.0, cudnn_v5.1, Titan X Pascal (not sure if these things matter)
Installing Bazel on Ubuntu can be done without compiling.
Follow all steps of the dedicated documentation: Install Bazel on Ubuntu

Errors when building AOSP using -make

I am trying to setup an environment to build android and run it on an emulator. I've gotten into AOSP very recently and currently reading a few books about it. Wanting to mess around with it myself I got the following error:
external/libcxx/include/cmath:1345:9: error: no member named 'llrint' in the global namespace; did you mean 'lrint'?
external/libcxx/include/cmath:1348:91: error: use of undeclared identifier 'llrintf'
external/libcxx/include/cmath:1349:91: error: use of undeclared identifier 'llrintl'
external/libcxx/include/cmath:1358:9: error: no member named 'llround' in the global namespace; did you mean 'lround'?
12 errors generated.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/src/hash.o] Error 1
make: *** Waiting for unfinished jobs....
12 errors generated.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/src/debug.o] Error 1
12 errors generated.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/src/random.o] Error 1
12 errors generated.
make: *** [out/host/darwin-x86/obj/STATIC_LIBRARIES/libc++_static_intermediates/src/algorithm.o] Error 1
In total twelve of these errors, with text in between but I haven't copied them all because they are quite the same. (all of them are: error no member named "{double L}[SOMETHING]"; did you mean: {single L}[SOMETHING])
This is the result of running: 1: source build/envsetup.sh 2: lunch 3: sudo make -j4
I am using El Capitan and have followed the official instructions. The only problem I encountered was that XCode didn't create a /developer/SDKs folder with the proper SDK in it so I manually downloaded the SDK from Github and put it in de SDKs folder (which I made). Is it possible that this is the problem?
The code that I am trying to build is un-modified android 6.0.1_r1. I tried running repo-init and repo sync again (to maybe fix the code) but with no effect.
I realise it's quite a stretch to ask, but I have no clue how to fix this. Thanks in advance.
you can try to use MacOSX10.11.sdk as your MacOSX-SDK
you can download MacOSX10.11.sdk from GitHub: https://github.com/phracker/MacOSX-SDKs
copy the MacOSX10.11.sdk to a particular path(such as ~/lib) and create a soft link to /Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
$ ln -s ~/lib/MacOSX10.11.sdk /Applications/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
(I also copy the MacOSX10.11.sdk to /Developer/SDKs/)
and modify the file int android source code: build/core/combo/mac_version.mk
mac_sdk_versions_supported := 10.9 10.10 10.11
done!
try to compile the source code again!
OS: macOS Sierra 10.12
Android Source Code: android6.0.1_r1C
XCode: Version 8.2.1
JDK: java version "1.8.0_101"

How to make Eclipse work with Gstreamer SDK?

I try to develop an Android app using Gstreamer. I use Fedora 20 with installed Eclipse with ADT and NDT, Android SDK and NDK, gstreamer SDK for Android. But something goes wrong, when I try to build tutorials.
Everything is OK, when I build NDK samples (like hello-jni), but building is not complited working with samples from gstreamer SDK (definitely it is android-tutorial-1 from [gstreamer sdk installation]/share/gst-sdk/tutorials/). Here is what i see in log:
13:13:10 **** Auto Build of configuration Default for project Tutorial1 ****
/home/staslatgttt/work/android-ndk-r10c/ndk-build all
GStreamer : [GEN] => gst-build/gstreamer_android.c
GStreamer : [COMPILE] => gst-build/gstreamer_android.c
GStreamer : [LINK] => gst-build/libgstreamer_android.so
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libgstreamer-0.10.a(libgstparse_la-lex.priv_gst_parse_yy.o): in function priv_gst_parse_yylex:lex.priv_gst_parse_yy.c:1598: error: undefined reference to '__srget'
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libglib-2.0.a(libcharset_la-localcharset.o): in function _g_locale_get_charset_aliases:localcharset.c:158: error: undefined reference to '__srget'
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libglib-2.0.a(libcharset_la-localcharset.o): in function _g_locale_get_charset_aliases:localcharset.c:167: error: undefined reference to '__srget'
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libintl.a(localcharset.o): in function locale_charset:./localcharset.c:195: error: undefined reference to '__srget'
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libintl.a(log.o): in function __sputc:/home/slomo/Projects/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.7/include-fixed/stdio.h:376: error: undefined reference to '__swbuf'
collect2: ld returned 1 exit status
make: *** [buildsharedlibrary] Error 1
13:13:11 Build Finished (took 972ms)
I tried to surf Internet, but I didn't find useful explanation how to solve this problem. All I understood is that problem is connected to Gold Linker. Only on this site http://docs.gstreamer.com/display/GstSDK/Installing+for+Android+development is a small tip about problems with Gold Linker on Windows, but I use Linux! Anyway, if I wanted to solve this problem on Windows, "this project" link mentioned there is not avaliable.
Can anyone help me with this? I don't know, what I do wrong, but I really need to solve this problem.
The NDK r10c wasn't support till 11-10-2014.
"The Android binaries are now built with the r10c NDK and as such binary compatible again with all NDK and Android releases" - http://gstreamer.freedesktop.org/
Try it again with the latest NDK and GStreamer Android SDK.
I encountered the same error... Google removed __srget starting from NDKr10c (check their official site in other fixed bugs). Downgrade to r10b or below and it should work.

Android 4 ICS (AOSP) build error on Ubuntu 10.04

I am trying to build Android 4.0.1_r1 on Ubuntu 10.04 64bit. I have followed all the steps as mentioned in the official build document before I initiated "make -j2" for a "full engineering" lunch type.
After 2 hours of compilation , I got this error :-
host Java: doclava (out/host/common/obj/JAVA_LIBRARIES/doclava_intermediates/classes)
Exception in thread "main" java.lang.RuntimeException: cts/tools/vm-tests-tf/src/dot/junit/opcodes/xor_long_2addr/Test_xor_long_2addr.java: trouble reading
at com.android.dx.util.FileUtils.readFile(FileUtils.java:87)
at util.build.BuildDalvikSuite.parseTestMethod(BuildDalvikSuite.java:588)
at util.build.BuildDalvikSuite.handleTests(BuildDalvikSuite.java:303)
at util.build.BuildDalvikSuite.compose(BuildDalvikSuite.java:159)
at util.build.BuildDalvikSuite.main(BuildDalvikSuite.java:131)
Caused by: java.io.FileNotFoundException: cts/tools/vm-tests-tf/src/dot/junit/opcodes/xor_long_2addr/Test_xor_long_2addr.java (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:120)
at com.android.dx.util.FileUtils.readFile(FileUtils.java:75)
... 4 more
make: * [out/host/linux-x86/obj/EXECUTABLES/vm-tests-tf_intermediates/tests] Error 1
make: * Waiting for unfinished jobs....
Note: external/doclava/src/com/google/doclava/Stubs.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
After this above error , the build stops.
Modifications I did before the build are as follows :-
From /devices folder I removed Google , Samsung and Ti folder so that they are not included in the build.
In the /build/target/product/core.mk I removed the following apps - Browser, HTMLViewer, Contacts
Although I am a complete beginner in Android source development, I'm having this hunch that the modifications may not be the actual cause of the build failure and root cause lies somewhere else. I need some advice on this.

Categories

Resources