The log information is as follows:
08-14 15:48:41.127:a/art (5526): art/runtime/check_jni.cc:70] JNI detected ERROR in Application:illegal class name ' xxx.x Xx.xxx '
08-14 15:48:41.127:a/art (5526): art/runtime/check_jni.cc:70] (should be of the form ' Package/class ', [Lpackage/class; ' O R ' [[B ']
08-14 15:48:41.127:a/art (5526): art/runtime/check_jni.cc:70] in call to Findclass
check_jni.cc Source Address:https://android.googlesource.com/platform/art/+/kitkat-dev/runtime/check_jni.cc
Looking at the log is an error in calling Findclass. The Checkclassname method is called to check if the class name is legal when Findclass. Checkclasname method source code is as follows:
//Checks that ' class_name ' is a valid "fully-qualified" JNI class name, like "Java/lang/thread" //or "[Ljava/lang/object;". A ClassLoader can actually normalize class names a couple of //times, so using "java.l Ang. Thread "instead of" Java/lang/thread "might work in some //circumstances Incorrect. void Checkclassname (const char * class_name) {if (! Isvalidjniclassname (class_name)) {jniabortf (function_name_, "illegal class Name '%s ' \ n ' , class_name); } }
The Isvalidjniclassname method was called in the Checkclassname method, and Google searched for "Isvalidjniclassname site:android.googlesource.com", The declaration of the Isvalidjniclassname method is found in Utils.h, implemented in utils.cc.
Here are the link addresses for Utils.h and utils.cc:
https://android.googlesource.com/platform/art/+/master/runtime/utils.h
https://android.googlesource.com/platform/art/+/kitkat-release/runtime/utils.cc
The Isvalidjniclassname method is implemented as follows:
He calls the Isvalidclassname method, noting that the third argument is ‘/‘
that this is the delimiter for the class name, and when I call Findclass here, the class name is ‘.‘
separated, and the problem is ‘/‘
resolved.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Resolving JNI calls in android5.x system flash-back problem