我刚刚安装了我的第一个Cordova项目并安装了OneSignal推送通知。这一切都如我所料,不过Android开发工具在控制台中显示了这一点:
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI local reference, dumping thread
W/art: Attempt to remove non-JNI
由于我已经更新了Flash开发和安装了Air/Flex的最新版本,所以由于以下错误,我无法再调试应用程序:
Debugger startup error. For troubleshooting see: http://www.flashdevelop.org/wikidocs/index.php?title=F.A.Q
Error details: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x
// example-1: GetStringUTFChars()
public class Prompt
{
// native method that prints a prompt and reads a line
private native String getLine(String prompt);
public static void main(String args[])
{
Prompt p = new Prompt();
String temp = new String("Type a line:
我尝试获取Native class字段mInt中的值。该类是由SimpleJNI创建的。在此示例中,我将mInt值设置为9。JNI函数add尝试使用GetIntField获取mInt值。它应该在add函数中返回9。但是似乎GetIntfield在这个jobject中找不到这个字段。如何从JNI获取mInt?感谢您的评论。
以下是JNI源代码。
static jfieldID gNative;
static jint add(JNIEnv *env, jobject thiz, jint a, jint b) {
int result = a + b;
LOGI("%d