android-ndk

Android NDK build-host-executable.mk: No such file or directory

心已入冬 提交于 2019-12-24 11:53:22
问题 Short question: I'm trying to build an app that has a JNI dependency, using Eclipse ADT and NDK r10e (the current version). The JNI dependency (apparently) builds a binary to run on the build host, using build-host-executable.mk from the NDK. However, that script seems to have been removed in recent NDK versions. What do I do? Long question: The JNI dependency is platform/external/srec from AOSP, which comes with an Android.mk file (actually, several of them). I have set up Eclipse to build

How to build boost 1.69.0 for Android with NDK r18b using moritz-wundke/Boost-for-Android?

懵懂的女人 提交于 2019-12-24 11:22:57
问题 I tried to use https://github.com/moritz-wundke/Boost-for-Android to compile boost for Android. It reports 1.69.0 is supported for NDK r18b. I'm under Windows 7. I encountered many problems, some of them I could fix, but finally I could not get anything compiled: Installed MinGW Installed MySYS Added MySYS to PATH Ran build-android.bat Got error: <path to NDK r18b> is not a valid NDK root -> Thats because the script checks if ndk-build exists -> Replaced "ndk-build" by "ndk-build.cmd" in

Is there asynchronous file i/o in Android NDK?

廉价感情. 提交于 2019-12-24 09:39:01
问题 I had to save/load a lot of data stored at the sdcard in my C++ android-ndk code. However, I was told that there is no async file IO <aio.h> in Android NDK, is that right? If so , can any of you give me an example (or guideline) of async read/write files in Android NDK? Thank you! 回答1: You are correct, there is no AIO available in the latest Android NDK: $ cd ~/android-ndk-r15/platforms/android-26 $ find . -type f -exec grep aiocb {} \; $ What is your primary use? Asynchronized reading or

Android: add prebuild object files

徘徊边缘 提交于 2019-12-24 09:34:06
问题 I'm building static library with ndk-4 and assembler coredumps on some of my assembly files. I used codesourcery assembler to create objects for these files. Now, I have no clue how to add these prebuild object files to the project. I tried to check inside their makefiles, but I don't see anything. I tried to add them to LOCAL_OBJECTS LOCAL_OBJECTS += $(NEON_LOCAL_OBJECTS) but it doesn't work. The value LOCAL_OBJECTS is reset to nothing inside build/core/build-binary.mk Most likely I'd be

FreeImage_GetFileType not working in Android NDK

旧城冷巷雨未停 提交于 2019-12-24 09:05:39
问题 I am currently trying to create a multiplatform application (targets are Windows and Android via ndk). So the problem is in textures (as in topic of this post). It works great on windows, but in Android FreeImage_GetFileType returns FIF_UNKNOWN , despite the fact that I can read part of .png file manually from same file path (only PNG file magic, beceause then it contains some null bytes). I use them this way (only part connected to this issue): Texture::Texture(std::string fpath) :Resource

One line NDK crashlogs on android

你说的曾经没有我的故事 提交于 2019-12-24 08:56:53
问题 We have application which depends on ndk library packaged as aar. Also this app builds it's own NDK code using cmake. We upload symbols using crashlyticsUploadSymbols<Flavor> task. And when I check build/fabric/<flavor>/release/csyms there is csym files for both libraries and all our supported architectures. Everything seems ok, but native crashes symbolicated like this. Lots info about system lines and no info about contents of libglmapview which is most interesting part of every crash. What

Using OpenCV nonfree module in Android

坚强是说给别人听的谎言 提交于 2019-12-24 08:41:05
问题 I'm trying to use the nonfree module with OpenCV on Android. I'm following this answer https://stackoverflow.com/a/28557686/6126070 but I'm having trouble understanding it since this is my first application using Android and NDK. Right now, OpenCV (without nonfree) is working on my application and I'm using it in C++ code with NDK and JNI. What I'm having trouble with is editing my current Android.mk and Application.mk files to thoses in the answer to compile nonfree. Here is my Android.mk

adding “-O0” to cppFlags fails to disable clang compile optimization in android studio

孤人 提交于 2019-12-24 08:39:06
问题 I am building my app in debug mode, and I notice some errors saying "parent failed to evaluate: no location, value may have been optimized out". Therefore, I try to add "-O0" in my module build.gradle like this: externalNativeBuild { cmake { cppFlags "-O0 -frtti -fexceptions -std=c++11 -DANDROID_ARM_NEON=TRUE -mfloat-abi=softfp " abiFilters "armeabi-v7a" } } But still, the same error shows up after adding "-O0". May I ask how to disable compiler optimization properly? My android Studio

Application crashing due to use of ANativeWindow API

感情迁移 提交于 2019-12-24 08:34:59
问题 I'm calling my native function that uses ANativeWindow API from the java code from an UI thread as shown below: MainActivity.this.runOnUiThread(new Runnable() { @Override public void run() { // your stuff to update the UI mainFunction(3,inputFile,outputFile,surface); Log.d(TAG, "Thread executed successfully"); } }); Then in the native code while copying the data from the rgba buffer to the bits, the application is carshing. Native code snippet is shown below: void yuv2rgba(UINT8* y,UINT8* u

Why am I getting this Android Studio error: “recompile with -fPIC”?

元气小坏坏 提交于 2019-12-24 08:23:09
问题 I am using NDK 18 and compiling a static library separately using the x86_64 NDK standalone toolchain. I can link it successfully but when I try to access the library in a non-trivial way I am getting dozens of errors when building saying things like: ... requires dynamic R_X86_64_PC32 reloc against '_ZZN4seal4util21get_msb_index_genericEPmmE15deBruijnTable64' which may overflow at runtime; recompile with -fPIC See my previous question for details on my build files: Why am I still getting