Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity Android: Didn't find class “com.unity3d.player.ReflectionHelper”

Discussion in 'Android' started by lb16618, Feb 2, 2018.

  1. lb16618

    lb16618

    Joined:
    Feb 2, 2018
    Posts:
    1
    I'm building a Unity Android app that makes use of some native android libraries. I had all of this nicely set up and working until I tried to move the calls to the native code onto another thread for performance reasons.

    I first had the issue of the JNI not liking the threading, so adding in a `AndroidJNI.AttachCurrentThread();` call fixed that fatal error. However now there is a new, non-fatal exception being thrown repeatedly and causing my native code to not work.

    The stacktrace is below, but it seems to be centered around the lack of a `com.unity3d.player.ReflectionHelper` class not being found by the JVM.

    Does anyone have any ideas where this could be going wrong?

    Thanks

    Code (CSharp):
    1. 02-02 15:25:05.194 10248-10416/com.limoncello.androidtest E/mono: Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for UnityEngine.AndroidReflection ---> UnityEngine.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]]
    2.                                                              java.lang.ClassNotFoundException: Didn't find class "com.unity3d.player.ReflectionHelper" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/system/lib, /vendor/lib, /system/lib, /vendor/lib]]
    3.                                                                   at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    4.                                                                   at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
    5.                                                                   at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    6.                                                                 at UnityEngine.AndroidJNISafe.CheckException () [0x0008c] in /Users/builduser/buildslave/unity/build/Runtime/Export/AndroidJNISafe.cs:24
    7.                                                                 at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x0000f] in /Users/builduser/buildsla
     
  2. Yode_group

    Yode_group

    Joined:
    Apr 5, 2016
    Posts:
    14
    Hello!

    Could you solve this problem?