NDK

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there someone who had experience with this error? java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.swig.simple-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "liborg.swig.simple.example.so" Error occurs when I load library by this way. static { System.loadLibrary("example"); } I'm sure 'example' class is exist in the current folder. 回答1: Please note that there's a naming convention. Your lib needs to be called libexample.so . LoadLibrary("example") will

Android NDK in Eclipse Type size_t could not be resolved

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting the follow error: "Type 'size_t' could not be resolved" on android ndk project, but I already added the library paths: /Users/ademar/android-ndk-r8e/platforms/android-8/arch-arm/usr/include /Users/ademar/android-ndk-r8e/sources/cxx-stl/stlport/stlport /Users/ademar/android-ndk-r8e/sources/cxx-stl/gnu-libstdc++/4.7/include so i not understand why this error. code where I get the error: static inline bool simplejson_wcsnlen(const wchar_t *s, size_t n) I added each one of headers described here but still not working. I Tried the

Linker errors in Android NDK (undefined reference to `__cxa_end_cleanup')

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm getting this output after adding in a set of code from a colleague: ./obj/local/armeabi/objs/jniWrapper/native.o: In function `_Vector_base': D:/opt/android-ndk/sources/cxx-stl/stlport/stlport/stl/_vector.h:73: undefined reference to `__cxa_end_cleanup' ./obj/local/armeabi/objs/jniWrapper/native.o:(.ARM.extab.text._ZNSt6vectorIhSaIhEEC1ERKS1_[std::vector<unsigned char, std::allocator<unsigned char> >::vector(std::vector<unsigned char, std::allocator<unsigned char> > const&)]+0x0): undefined reference to `__gxx_personality_v0' ./obj/local

NDK Error occured while importing telegram source code from github

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I downloaded telegram open source code for android from the following the link https://github.com/DrKLO/Telegram . While importing the project am getting the following errors: External Native Build Issues Build command failed. Error while executing process C:\Users\user\AppData\Local\Android\sdk\ndk -bundle\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni\Android.mk NDK_APPLICATION_MK=C:\Users\user\AndroidStudioProjects\Telegram-master\TMessagesProj\jni

How to build OpenSSL as unversioned shared lib for Android?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to build the latest OpenSSL for Android following Compiling the latest OpenSSL for Android . I manage to build the static libs. However I try to compile the shared libs. To do so I run: ./Configure android-armv7 shared This compiles. Problem is that this creates a versioned lib like libssl.so.1.0.0, which is not supported by Android. Just rename does not do because of SONAME is still pointing to the versioned filename. Different problem I have is when trying to the create the libs for old armeabi platform. When I run: ./Configure

Android NDK STL c++_shared w/LIBCXX_FORCE_REBUILD results in std::stringstream NOP

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: tl;dr: The question is for an explanation for why std::stringstream "fails", and why it fails in the way it does (by simply doing nothing), when linking to a rebuilt c++_shared library. A minimal example: std::stringstream ss; ss << "Hello World"; __android_log_print(ANDROID_LOG_INFO, "APP", "Length: %i", ss.str().size()); When compiling the project with APP_STL := c++_shared LIBCXX_FORCE_REBUILD := true The output is Length: 0 . When using APP_STL := c++_static or LIBCXX_FORCE_REBUILD := false , the stringstream works as expected, with

Cross Compiling libevent for Android

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm stuck trying to cross-compile libevent to Android and I'd like to know what I'm doing wrong and get some assistance. The version I'm trying to build is libevent-2.0.19-stable I started following the steps described at http://warpedtimes.wordpress.com/2010/02/03/building-open-source-libraries-with-android-ndk/ and how to rewrite the Makefile into android.mk? The Target Device is a Samsung Galaxy S2 running cyanogenMod 7 After several attempts, the best I did was by running the following steps: 1) Install android NDK and download libevent

Android NDK C++ JNI (no implementation found for native…)

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to use the NDK with C++ and can't seem to get the method naming convention correct. my native method is as follows: extern "C" { JNIEXPORT void JNICALL Java_com_test_jnitest_SurfaceRenderer_drawFromJni (JNIEnv* env, jclass c) { // } } with a header wrapped in extern "C" {} aslo. Everything compiles fine, creates a .so file and copies to the libs folder under my project, but when I debug and run in Eclipse I keep getting a log cat message that of "no implementation found for native...". Is there something i'm missing as all the NDK

Read build arguments from NDK code

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an NDK file that inject my api key into my app, the code works correctly: #include <jni.h> JNIEXPORT jstring JNICALL Java_yt_javi_nftweets_ui_main_MainActivity_getTwitterKey(JNIEnv *env, jobject instance) { return (*env)-> NewStringUTF(env, "my_twitter_key"); } I would like to change my_twitter_key by an custom build argument externalNativeBuild { ndkBuild { arguments "-DTWITTER_API_KEY=my_twitter_key" } } And read that argument inside the method Java_yt_javi_nftweets_ui_main_MainActivity_getTwitterKey 回答1: You could add a define to

Google protobuf and Android NDK

匿名 (未验证) 提交于 2019-12-03 02:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to build Google protobuf (c++ version, https://github.com/google/protobuf/releases/latest ) with Android target? 回答1: I compiled protobuf without ndk-build. Here's the script (not very clean but it works): rm -rf /tmp/protobuf-3.3.0/ tar xzvf ~/Downloads/protobuf-cpp-3.3.0.tar.gz -C /tmp/ cd /tmp/protobuf-3.3.0/ export NDK_ROOT=/home/user/SDKS/ANDROID/NDK/android-ndk-r13b export SYSROOT=$NDK_ROOT/platforms/android-9/arch-arm export PREBUILT=$NDK_ROOT/toolchains/arm-linux-androideabi-4.9 export LDFLAGS="--sysroot=$SYSROOT" export LD="$NDK