Bad JNI version passed to AttachCurrentThread:
2014-03-13 16:56
846 查看
出现这个错误时,发现JNI层有error打印,原因是 java version没有提供
if (event == ASSOCIATE_JVM) {
JavaVMAttachArgs args;
char name[] = "XX Service Callback Thread";
//args.version = JNI_VERSION_1_6;
args.name = name;
args.group = NULL;
vm->AttachCurrentThread(&callbackEnv, &args);
ALOGV("Callback thread attached: %p", callbackEnv);
}
修改成下面的就OK了
if (event == ASSOCIATE_JVM) {
JavaVMAttachArgs args;
char name[] = "XX Service Callback Thread";
args.version = JNI_VERSION_1_6;
args.name = name;
args.group = NULL;
vm->AttachCurrentThread(&callbackEnv, &args);
ALOGV("Callback thread attached: %p", callbackEnv);
}
if (event == ASSOCIATE_JVM) {
JavaVMAttachArgs args;
char name[] = "XX Service Callback Thread";
//args.version = JNI_VERSION_1_6;
args.name = name;
args.group = NULL;
vm->AttachCurrentThread(&callbackEnv, &args);
ALOGV("Callback thread attached: %p", callbackEnv);
}
修改成下面的就OK了
if (event == ASSOCIATE_JVM) {
JavaVMAttachArgs args;
char name[] = "XX Service Callback Thread";
args.version = JNI_VERSION_1_6;
args.name = name;
args.group = NULL;
vm->AttachCurrentThread(&callbackEnv, &args);
ALOGV("Callback thread attached: %p", callbackEnv);
}
相关文章推荐
- jni: bad arguments passed to 错误
- JNI|在子线程中获得JNIEnv|AttachCurrentThread
- JNI - AttachCurrentThread
- 在子线程中获得JNIEnv|AttachCurrentThread
- android Jni AttachCurrentThread 内存泄露
- AndroidJNI.AttachCurrentThread
- JNI|在子线程中获得JNIEnv|AttachCurrentThread
- JNI|在子线程中获得JNIEnv|AttachCurrentThread
- 解决COCOS2D-X与JNI交互游戏出现崩溃的问题call to OpenGL ES API with no current context (logged once per thread)
- OpenGL ES开发中遇到call to OpenGL ES API with no current context (logged once per thread) 问题原因
- Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
- Tomcat启动web项目报Bad version number in .class file (unable to load class ...)错误的解决方法
- [b[bug小记]System.loadLibrary加载so库时报警告JNI_OnLoad returned bad version(-1)并且crash
- Tomcat启动web项目报Bad version number in .class file (unable to load class ...)错
- SVN历史版本比较报错:Bad URL passed to RA layer
- BSD process name correspondlng to current thread: knernel_task Mac OS version Not yet set
- Android: call to OpenGL ES API with no current context (logged once per thread)
- Bad arguments passed to org.jboss.resteasy.spi.metadata.ResourceMethod
- cocos2dx- call to OpenGL ES API with no current context(logged once per thread)
- call to OpenGL ES API with no current context (logged once per thread)