Answer the question
In order to leave comments, you need to log in
Jni GetMethodID returns NULL, android 5.1.1?
Initializing the constructor for the java.net.InetAddress class returns NULL. I assume that the problem is in the new garbage collector that is used in ART.
jclass iaddrclass = env->FindClass("java/net/InetAddress");
if (iaddrclass == NULL) {
jniThrowException(env, "java/lang/ClassNotFoundException",
"java.net.InetAddress");
return;
}
gCachedFields.iaddr_class = (jclass) env->NewGlobalRef(iaddrclass);
//problem is in this line
jmethodID iaddrclassinit = env->GetMethodID(iaddrclass, "<init>", "()V");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question