android-ndk

Manually (aapt) add native library .so to apk

▼魔方 西西 提交于 2020-01-16 00:54:34
问题 For multiple reasons I'm building my project manually (more or less following these steps http://geosoft.no/development/android.html), whithout using ant. My projects uses the NDK and builds a .so library. With Eclipse: When I use Eclipse to build my project, everything works: I drag&drop libMyNativeLib.so in the libs/armeabi directory and when I call loadLibrary(MyNativeLib) it works fine: I can call native method from my Java code. Manually: Now I want to build manually my .apk . Everything

How to add prebuilt .so library in android studio 0.8.6

邮差的信 提交于 2020-01-15 10:17:12
问题 The Error I will get is Couldn't load json from loader dalvik.system.PathClassLoader[DexPathList[dexElements=[zip file "/data/app/com.uei.tools.ndktest-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.uei.tools.ndktest-1, /vendor/lib, /system/lib]]]: findLibrary returned null I created a zip file of all .so files and i added into libs folder under app folder i added jar dependency from Module settings dependency. All serch resulted in sample code of old versions of android studio but there

Cannot find declaration in C++ code after upgrade to NDK 14

谁说我不能喝 提交于 2020-01-15 09:45:13
问题 I updated my Android Studio 2.3 to use NDK 14. Everything works as expected when you use the code (code compiles and the app is running as expected). However, for some reason, when you try to jump to the deceleration of any C++ object/function/variable you get a message that studio (regardless of the code): Cannot find declaration to go to Here is a screenshot of what I see: Edit: I just downgraded back to NDK 13b and the problem was solved. This is a workaround, but without a fix I would not

Native crash (UnsatisfiedLinkError) when the application is updated

允我心安 提交于 2020-01-15 09:36:08
问题 I have an app that uses some native code. The applications works fine and contains all the abis but in some android devices like Galaxy Note5 with Android 7.0 and SM-G955U (Samsung Galaxy S8 plus) with Android 7.0 the application crashes with the following error: Fatal Exception: java.lang.UnsatisfiedLinkError: Native method not found These are the abis included in the APK: arm64-v8a armeabi armeabi-v7a mips mips64 x86 x86_64 Anybody knows how can I fix that? Thanks! 回答1: Looks like this is a

No JNI_OnLoad and no return value from native function?

余生长醉 提交于 2020-01-15 09:05:11
问题 i need to make linux command from native method by c++ code. this is my class Test.java public class Test { static { System.loadLibrary("NDK1"); } public native String exec(String cmd); } then i create header .h by this command : $ javah -classpath ../bin/classes com.example.new1.Test after this the header .h is created in this path com.example.new1 then i create jni file and copy .h file and create .cpp file and include .h in it. #include <string> #include <iostream> #include <stdio.h>

No JNI_OnLoad and no return value from native function?

主宰稳场 提交于 2020-01-15 09:04:50
问题 i need to make linux command from native method by c++ code. this is my class Test.java public class Test { static { System.loadLibrary("NDK1"); } public native String exec(String cmd); } then i create header .h by this command : $ javah -classpath ../bin/classes com.example.new1.Test after this the header .h is created in this path com.example.new1 then i create jni file and copy .h file and create .cpp file and include .h in it. #include <string> #include <iostream> #include <stdio.h>

Why does SDL freezes on changing & resuming focus?

牧云@^-^@ 提交于 2020-01-15 07:24:13
问题 We are using SDL-2.0.8 for UI in our application on Android. The application is a bit complex entity altogether & the issue we are facing is that the UI will freeze whenever the application looses focus & is resumed. The UI freezes on either of the below scenarios. If the settings drop-down is dragged (Just pull down the settings screen from the top). When the home button is pressed & the application is resumed. If the application is switched between an another application. When the

Android NDK wifi example

别来无恙 提交于 2020-01-15 05:55:51
问题 I want to use features of WIFI with the help of c code by using NDK in android. I don't want to use Java API for WIFI. I tried on Google as well as on stackoverflow, but I didn't got any example for it. I am just wondering , let me know is it possible or not ? I have found some android API for WIFI. but I haven't any knowledge of implementation. 回答1: You may wanna look at libcurl, but not quite sure. Because I am developing games using cocos2d-x (which is using android ndk), and libcurl is

Linux C++: Linker is outputting strange errors

那年仲夏 提交于 2020-01-15 03:48:08
问题 Alright, here is the output I get: arm-none-linux-gnueabi-ld --entry=main -dynamic-linker=/system/bin/linker -rpath-link=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -L/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -nostdlib -lstdc++ -lm -lGLESv1_CM -rpath=/home/oem/android-ndk-r3/build/platforms/android-5/arch-arm/usr/lib -rpath=../../YoghurtGum/lib/Android -L./lib/Android intermediate/Alien.o intermediate/Bullet.o intermediate/Game.o intermediate

compile ICS/JB camera application - native library jni-mosaic error

核能气质少年 提交于 2020-01-14 14:19:48
问题 I would like to use the Panorama mode that the ICS/JB camera application has. I've downloaded the source code (with resources) and managed to solve all code compilation errors but as soon as I start the application on my device (running JB), I get this error: 10-25 14:42:53.617: E/AndroidRuntime(23147): FATAL EXCEPTION: GLThread 2586 10-25 14:42:53.617: E/AndroidRuntime(23147): java.lang.UnsatisfiedLinkError: Native method not found: com.app.camera.panorama.MosaicRenderer.reset:(IIZ)V 10-25