JNI

JNI ERROR (app bug): accessed stale local reference 0xbc00021 (index 8 in a table of size 8)

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I made hello world application from book Android apps for Absolute Beginners and Temperature Convertor app from here Both is running fine on Emulator but when I try to run it on Samsung Note 2 following error is coming on LogCat 02-08 07:22:18.665: E/dalvikvm(30944): JNI ERROR (app bug): accessed stale local reference 0xbc00021 (index 8 in a table of size 8) 02-08 07:22:18.665: E/dalvikvm(30944): VM aborting 02-08 07:22:18.665: A/libc(30944): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 30944 (oid.temperature) Both applications

JNI - How to convert jshortArray to short *

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a dll file that contains the following function: unsigned char * EncodingData(short Data[], int Length); I want to call this native method in java. So I have created one wrapper dll that contains the follwing function corresponding to the above function JNIEXPORT jcharArray JNICALL Java_com_common_FilterWrapper_EncodingData (JNIEnv * env, jclass cls, jshortArray shortData, jint len) Now I am calling the above JNI function from java and it is being called successfully. Problem: I want to call the dll file's function from wrapper dll's

JNI %1 is not a valid Win32 application

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm running Netbeans on 64-bit Windows 8, with JDK 1.7_25 (64-bit), following the instructions for the Beginning JNI with NetBeans ( https://netbeans.org/kb/docs/cnd/beginning-jni-linux.html ) The instructions are for linux, but the principle is the same for Windows I believe (generating a .dll file instead of .so, using win32 includes in the JDK, etc) I have Cygwin64 installed as well as Cygwin32. Using Cygwin64, I'm able to generate a 64-bit DLL from my C/C++ Dynamic Library project. However, when I call System.load("path/to/JNITest.dll"),

Error SSL archive symbol table (run ranlib)

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I built OpenSS1.0.2g for SmartfoxClient API 1.6.3 (Cocos2dx v3 - Android - Window10 64bit). It throws error: Error SSL archive symbol table (run ranlib) . My config in Android.mk LOCAL_CFLAGS += -I$(LOCAL_PATH)/boost LOCAL_CFLAGS += -I$(LOCAL_PATH)/OpenSSL/include LOCAL_CFLAGS += -I$(LOCAL_PATH)/../libs/smartfox LOCAL_LDLIBS += -L$(LOCAL_PATH)/lib LOCAL_LDLIBS += -L$(LOCAL_PATH)/OpenSSL/lib LOCAL_LDLIBS += -lboost_system -lboost_thread -lboost_regex -lcrypto -lssl LOCAL_CPPFLAGS += -fexceptions LOCAL_CPPFLAGS += -frtti LOCAL_CPPFLAGS += -w

UnsatisfiedLinkError calling JNI generated by SWIG?

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to create a C dynamic library that's callable from Java. I've compiled a DLL under Cygwin , using SWIG to generate the JNI with the following makefile: CC = gcc - mno - cygwin SWIG = /cygdrive/ c / Documents \ and \ Settings / student / Desktop / swigwin - 2.0 . 4 / swig . exe - java INCLUDE1 = - I / cygdrive / c / Program \ Files / Java / jdk1 . 6.0 _25 / include INCLUDE2 = - I / cygdrive / c / Program \ Files / Java / jdk1 . 6.0 _25 / include / win32 utilities : $ { SWIG } utilities . i $ { CC } - c utilities . c

JNI : Exception in thread “AWT-EventQueue-0” java.lang.UnsatisfiedLinkError

匿名 (未验证) 提交于 2019-12-03 00:58:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am working on application in java.I have use JNI layer to communicate java with the C layer .But while calling the native function in java , the application gives following exception, Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: org.jni.DeviceCommunicationController.Ivb_GetGain(I)F at org.jni.DeviceCommunicationController.Ivb_GetGain(Native Method) at org.jni.GetGain.<init>(GetGain.java:11) at org.mainWindow.AppWindow$3.stateChanged(AppWindow.java:281) at javax.swing.JSlider.fireStateChanged(Unknown Source) at

JNI for C using Swig &amp; trouble with function pointer callback

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: we have a C function in one of the libraries which are loaded in java, which accepts a function pointer function defination as below typedef char int8 typedef unsigned short uint16 uint32 poll_broadcasts(void *(pfn)(int8*,uint16)); In C it is used as below void handle_broadcasts( int8 *broadcast, uint16 length ) uint32 a = poll_broadcasts( (void*(*)(int8*,uint16)) handle_broadcasts ) But when you use Swig to generate JNI wrapper it creates following definition for poll_broadcast public static long poll_broadcasts(SWIGTYPE_p_f_p_char_unsigned

Error: JNI ERROR (app bug): accessed stale global reference

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting this error JNI ERROR (app bug): accessed stale global reference When I run my app in Android OS v4, But when I run the same application in Android v2.3 I don't get this error. This error occurs at the point where I call AsyncTask class, where I pass a string array as argument Could Anyone Help me?? 回答1: This error occurs when you call a method with an incorrect parameter type. Make sure your method signature matches exactly what you are passing. For a string array: jmethodID mid = env->GetMethodID(cls, methodName, "([Ljava/lang

JNI_OnLoad returned bad version (-1)

匿名 (未验证) 提交于 2019-12-03 00:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to load the Qt5Core library in my Android application and I get this: JNI_OnLoad returned bad version (-1) in /data/data/com.xxx.yyy/lib/libQt5Core.so 0x41a8f3c0 Failed to load library : Qt5Core due to link error unknown failure java.lang.UnsatisfiedLinkError: unknown failure at java.lang.Runtime.loadLibrary(Runtime.java:370) This is the way how I'm trying to load it: System.loadLibrary(s); where "s" is an array containing several library names. The other libraries are loaded correctly.. Any ideas are welcome! EDIT SO I'm getting

Android facebook sdk appinvites AppInviteDialog white screen

匿名 (未验证) 提交于 2019-12-03 00:52:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi im having this problem, when i try to send facebook appinvites from my android app it just hangs on this white dialog forever: . I've tried in emulators and real devices and it just keeps doing the same. I followed this guide: https://developers.facebook.com/docs/app-invites/android . Its wierd because at start i wasn't having this problem, it was opening fine and could see facebook friends and send the invitations but suddenly it just stopped working. I've been searching for a solution and cant find anything. Some info: Im using facebook