android-ndk

Android ndk-build iostream: No such file or directory

丶灬走出姿态 提交于 2019-12-28 05:56:49
问题 I'm having problem with compiling cpp file using ndk-build tool (windows 7 with cygwin) Error appears when I try to compile cpp file with #include: jni/native.cpp:5:20: error: iostream: No such file or directory Here is my cpp file: #include <jni.h> #include <string.h> #include <stdio.h> #include <android/log.h> #include <iostream> #define DEBUG_TAG "NDK_SampleActivity" #define LOG_TAG "hellojni" #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) #define LOGE(...) _

Cross compiling static C hello world for Android using arm-linux-gnueabi-gcc

谁说我不能喝 提交于 2019-12-28 03:21:21
问题 I want to build a static hello world from C using arm-linux-gnueabi-gcc as opposed to using the NDK standalone toolchain or Codesourcery for that matter. In Ubuntu... I have done the following: sudo apt-get install gcc-arm-linux-gnueabi I created a hi.c like this: #include <stdio.h> int main(int argc, char** argv) { printf("hello world\n"); return 0; } I have compiled it like this: arm-linux-gnueabi-gcc -static hi.c -o hi I ran it on an emulator like this: adb push hi /data/hi adb shell /data

Cross compiling static C hello world for Android using arm-linux-gnueabi-gcc

你离开我真会死。 提交于 2019-12-28 03:21:09
问题 I want to build a static hello world from C using arm-linux-gnueabi-gcc as opposed to using the NDK standalone toolchain or Codesourcery for that matter. In Ubuntu... I have done the following: sudo apt-get install gcc-arm-linux-gnueabi I created a hi.c like this: #include <stdio.h> int main(int argc, char** argv) { printf("hello world\n"); return 0; } I have compiled it like this: arm-linux-gnueabi-gcc -static hi.c -o hi I ran it on an emulator like this: adb push hi /data/hi adb shell /data

How to make Android apps which support both 32-bit and 64-bit architecture?

烂漫一生 提交于 2019-12-27 17:37:13
问题 I've just received and read a newsletter from Google Play mentioning that from next year on, the store "will require that new apps and app updates with native libraries provide 64-bit versions in addition to their 32-bit versions". For those who haven't read it yet, it states: 64-bit support requirement in 2019 Platform support for 64-bit architectures was introduced in Android 5.0. Today, over 40% of Android devices coming online have 64-bit support, while still maintaining 32-bit

[INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

元气小坏坏 提交于 2019-12-27 17:18:52
问题 I have an issue with third party libraries that are imported to my project. I read quite a lot of articles about that but do not get any information how properly handle it. I put my classes .so to the folder. Problem is that the i try to run the app i receive [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113] 回答1: July 25, 2019 : I was facing this issue in Android Studio 3.0.1 : After checking lots of posts, here is Fix which works: Go to module build.gradle and

Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

左心房为你撑大大i 提交于 2019-12-27 11:49:45
问题 I want to compile an open source android project (Netguard) using gradel ( gradlew clean build ) But I encountered this Error: A problem occurred configuring project ':app'. > Exception thrown while executing model rule: NdkComponentModelPlugin.Rules#cre ateToolchains > No toolchains found in the NDK toolchains folder for ABI with prefix: llvm I serached but didn't find enything helping. Here is the main build.gradle : buildscript { repositories { jcenter() } dependencies { classpath 'com

While finding a difference between 2 pictures OpenCV difference is bigger than it is supposed to be

断了今生、忘了曾经 提交于 2019-12-25 17:04:49
问题 I'm working with OpenCV (in Android NDK) and I have a problem. I want to find differences between two pictures, and than cut the difference. However, following output made difference bigger. I used images from this question CV - Extract differences between two images . And I tried to solve it but unsuccessfully. Here is the output Mat& backgroundImage = *(Mat*) addrRgba; Mat& currentImage = *(Mat*) addrRgba2; Mat diffImage; absdiff(backgroundImage, currentImage, diffImage); Mat mask

Call native library method in independent native library

大憨熊 提交于 2019-12-25 16:56:04
问题 I am trying to implement the solution stated in this stackoverflow post. As the solution suggests, I created a independent native library. This how I have implemented that library thus far. #include "zoom_Main_VideoPlayer.h" #include <dlfcn.h> void *handle; typedef int (*func)(int); // define function prototype func myFunctionName; // some name for the function JNIEXPORT void JNICALL Java_zoom_render_RenderView_naClose(JNIEnv *pEnv, jobject pObj) { handle = dlopen("path to nativelibrary1.so",

Call native library method in independent native library

时光总嘲笑我的痴心妄想 提交于 2019-12-25 16:55:44
问题 I am trying to implement the solution stated in this stackoverflow post. As the solution suggests, I created a independent native library. This how I have implemented that library thus far. #include "zoom_Main_VideoPlayer.h" #include <dlfcn.h> void *handle; typedef int (*func)(int); // define function prototype func myFunctionName; // some name for the function JNIEXPORT void JNICALL Java_zoom_render_RenderView_naClose(JNIEnv *pEnv, jobject pObj) { handle = dlopen("path to nativelibrary1.so",

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol “__aeabi_memcpy8” referenced by mylib.so

ぐ巨炮叔叔 提交于 2019-12-25 14:49:06
问题 When my app runs in Android 6.0 or below devices(Nexus 5, Galaxy 3...), it crashes at System.loadLibrary("mylib"); It works fine with Android 7.0 devices(Nexus 5x, Nexus 9). I use latest Android Studio(2.2) and NDK. Log cat message is java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__aeabi_memcpy8" referenced by mylib.so. Below is part of build.gradle. compileSdkVersion 24 buildToolsVersion '24.0.2' defaultConfig { applicationId "myApp" minSdkVersion 10 targetSdkVersion