S
S
starling_ua2015-09-02 14:09:35
Java
starling_ua, 2015-09-02 14:09:35

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");


iaddrclassinit is NULL.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question