Android NDK compile fails at
[arm64-v8a] Install : libtmessages.29.so => libs/arm64-v8a/libtmessages.29.so
[armeabi-v7a] SharedLibrary : libtmessages.29.so
jni/./ffmpeg/armv7-a/libavutil.a(mem.o): In function `av_malloc':
mem.c:(.text+0x60): undefined reference to `posix_memalign'
collect2.exe: error: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libtmessages.29.so] Error 1
Can anybody suggest me what's wrong with it.
I am using Android Studio 3.1.4.
NDK: android-ndk-r17c
Using Windows 7 32bit.
This happens while compiling on fresh download of Telegram source code from
git clone — recursive https://github.com/DrKLO/Telegram.git
First I thought this might be because of NDK, I tried with ndk-r16b with same error while ndk-r14b and r15b return
Android NDK: ERROR:jni/Android.mk:avutil: The LOCAL_SRC_FILES for a prebuilt library should only contain one item
G:/Softwares/android-ndk-r15c/build//../build/core/prebuilt-library.mk:28: *** missing separator. Stop.
If anybody has gone through this, please mention here what is the cause behind this and how we can do it.
Use ndk r16b.
Works fine with the latest changes at a724d96e
Found the answer here:
https://github.com/grishka/libtgvoip/issues/8#issuecomment-417647322
Related
I am currently working on trying to compile the stressapptest (link: https://github.com/stressapptest/stressapptest) using the NDK environment, and for some reason, I'm having a hard time. These are the steps that I have taken:
Clone the repository onto my computer
Added a jni folder and moved all the files into it
Created an Application.mk file
Opened PowerShell from the location of my jni folder and execute ndk-build. This is the error I'm getting:
PS C:\Users\...\Desktop\stressapptest-master\stressapptest-master> ndk-build
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-16.
[arm64-v8a] Compile++ : stressapptest <= main.cc
In file included from jni/src/main.cc:17:
jni/src/sattypes.h:25:10: fatal error: 'algorithm' file not found
#include <algorithm>
^~~~~~~~~~~
1 error generated.
make: *** [obj/local/arm64-v8a/objs/stressapptest/src/main.o] Error 1
Is there anything else that I need in order to compile this to run on an Android system?
Set APP_STL to c++_shared in your Application.mk. ndk-build does not use any STL by default.
Hello I am new to Android and I am trying to build the hello-jni sample that is included in the NDK but I get the error below, any idea how to fix it?
15:57:10 ** Build of configuration Default for project HelloJni **
/media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/ndk-build
all Android NDK: WARNING: APP_PLATFORM android-19 is larger than
android:minSdkVersion 3 in ./AndroidManifest.xml [armeabi-v7a]
Compile thumb : hello-jni <= hello-jni.c arm-linux-androideabi-gcc:
error trying to exec
'/media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/as':
execv: Exec format error make: *
[obj/local/armeabi-v7a/objs/hello-jni/hello-jni.o] Error 1
15:57:10 Build Finished (took 230ms)
This is what I am using:
Ubuntu 10.04.4
ADT bundle for linux (v22.3.0-887826)
NDK r9c
Thanks in advance
The WARNING is correct, and should be ignored.
Regarding the gcc error, you probably have a problem with installation of NDK. How did you unpack it? Check
ls -l /media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/arm-linux-androideabi/bin/as
This should be a symbolic link to ../../bin/arm-linux-androideabi-as, and both should have executable permissions.
I'm new to Android programming and NDK, so i've followed this tutorial:
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/ to
install and config cygwin and NDK. The problem appears when I try to execute
ndk-build command. It displays the following error message:
$ $NDK/ndk-build
Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 3in ./AndroidManifest.xml
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
install: nie można wykonać stat na `/cygdrive/d/Programowanie/Tools/ADT/NDK/prebuilt/android-arm/gdbserver/gdbserver': No such file or directory
/cygdrive/d/Programowanie/Tools/ADT/NDK/build/core/setup-toolchain.mk:155: polecenia dla obiektu 'libs/armeabi/gdbserver' nie powiodły się
make: *** [libs/armeabi/gdbserver] Błąd 1
Error messages are written in polish so here's my translation, however I'm not sure whether
it's fully correct:
$ $NDK/ndk-build
Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 3in ./AndroidManifest.xml
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
install: Cannot execute stat on `/cygdrive/d/Programowanie/Tools/ADT/NDK/prebuilt/android-arm/gdbserver/gdbserver': No such file or directory
/cygdrive/d/Programowanie/Tools/ADT/NDK/build/core/setup-toolchain.mk:155: commands for object 'libs/armeabi/gdbserver' didn't succeed.
make: *** [libs/armeabi/gdbserver] Error 1
I honestly have no idea what could have caused such an error, so I'm counting that
You can help me anyhow.
Thanks :-)
Modern versions of NDK do not need cygwin. Try to run you build from normal cmd prompt. To be on the safe side, remove cygwin\bin from PATH.
I have fixed my issue with NDK by downloading it again and reinstalling.
It seems like I haven't downloaded entire NDK package, and that it caused
the problem. Sorry for trouble, I should have checked whether reinstall
could help in this case on the beginning, but this idea must have slept
my mind.
Thanks for letting me know that I don't need cygwin for NDK anymore :-)
Best regards, Buyuk.
Hi I have been working for weeks to compile ffmpeg library on Windows platform.But I found no way so far.Is it there any way to compile ffmpeg library on Windows 7.
I am using Cygwin on Windows.
Whenever I try to do ndk-build I get this message.
Android NDK: ERROR:jni/yuv2rgb/Android.mk:ffmpeg-prebuilt: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that jni/ffmpeg-build/armeabi/libffmpeg.so exists or that its path is correct
/cygdrive/D/AndroidNDK/android-ndk-r8c/build/core/prebuilt-library.mk:43: *** Android NDK: Aborting . Stop.
& while searching for solution of this error I found that I will have to compile the libraries first.For compiling by using ./build_android.sh. I got this error message.
./build_android.sh
./build_android.sh: line 72: ./configure: No such file or directory
Please please guide me what should I do.
I am getting some issues here while I am trying to compile my code with Cgywin.
$ /cygdrive/c/native_work/android-ndk-r8b/ndk-build
Android NDK: WARNING: Unsupported source file extensions in jni/Android.mk for module main
Android NDK: NotePaperDetector.hpp
Install : libmain.so => libs/armeabi-v7a/libmain.so
so how I can compile the .hpp file ?
Now as #mah you said I have removed it from my Android.mk but now its showing some different error -
$ /cygdrive/c/native_work/android-ndk-r8b/ndk-build
Compile++ thumb : main <= NotePaperDetector.cpp
In file included from jni/NotePaperDetector.hpp:4:0,
from jni/NotePaperDetector.cpp:1:
jni/NoteLocation.hpp:4:30: fatal error: opencv2/opencv.hpp: No such file or directory
compilation terminated.
/cygdrive/c/native_work/android-ndk-r8b/build/core/build-binary.mk:255: recipe for target `obj/local/armeabi-v7a/objs/main/NotePaperDetector.o' failed
make: *** [obj/local/armeabi-v7a/objs/main/NotePaperDetector.o] Error 1
With the latest NDK releases you don't need Cygwin at all.
By the way a GNU/Linux platform is always the best for Android developers.