- Home /
Reflectionhelper not find
Hi I try to call some java method in OnAudioFilterRead function body.
Here is the code segment.
void OnAudioFilterRead(float[] data, int channels)
{
AndroidJNI.AttachCurrentThread();
if (ok)
{
if (obj == null)
{
obj = new AndroidJavaObject("com.xx.aop.media.av.GPUFrameCapturer");
Debug.Log(obj.Call<bool>("isRecording"));
}
}
}
When I build apk on android platform.
Always encountered this issure.
06-13 15:20:51.981 20255-20388/com.MeiTu.XRay E/Unity: AndroidJavaException: java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.ReflectionHelper" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/system/lib, /vendor/lib, /system/lib, /vendor/lib]]
java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.ReflectionHelper" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/system/lib, /vendor/lib, /system/lib, /vendor/lib]]
Please help me .thanks.
Answer by heitaoflower · Aug 21, 2018 at 08:08 AM
OK, I solved this problem by myself.
The key stuff is ...The first AndroidJavaObject or related things must be call at unity main thread.
the main thread own the related AndroidJNI or helper something like that class.
On the other side.
When you try to call AndroidJavaObject on other threads. Must be called AttachThread before.
That is all.
Your answer

Follow this Question
Related Questions
Unable to call method via AndroidJNI.CallStaticVoidMethod 0 Answers
Can I get a list of methods for a class with JNI? 3 Answers
Inherit class from AndroidJavaObject 1 Answer
How to use AndroidJavaClass.Call() to pass a ArrayList or Array 1 Answer
Calling a java method from a second thread is not working 1 Answer