KeepSafe / ReLinker

A robust native library loader for Android.
Apache License 2.0
3.23k stars 371 forks source link

1.4.4 - Extremely Rare Android 12: Exception java.lang.NullPointerException #101

Open danoli3 opened 2 years ago

danoli3 commented 2 years ago

Exception java.lang.NullPointerException

Screen Shot 2022-08-31 at 12 37 11 am

Code stack:

Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.File android.content.Context.getDir(java.lang.String, int)' on a null object reference
  at android.content.ContextWrapper.getDir (ContextWrapper.java:335)
  at com.getkeepsafe.relinker.ReLinkerInstance.getWorkaroundLibDir (ReLinkerInstance.java:215)
  at com.getkeepsafe.relinker.ReLinkerInstance.getWorkaroundLibFile (ReLinkerInstance.java:230)
  at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal (ReLinkerInstance.java:173)
  at com.getkeepsafe.relinker.ReLinkerInstance.access$000 (ReLinkerInstance.java:31)
  at com.getkeepsafe.relinker.ReLinkerInstance$1.run (ReLinkerInstance.java:142)
  at java.lang.Thread.run (Thread.java:920)

Calling code:

  ReLinker.loadLibrary(this, "openFrameworksAndroid", new ReLinker.LoadListener() {
                @Override
                public void success() {
                    OFAndroidLifeCycle.coreLibraryLoaded = true;
                    Setup();
                }
                @Override
                public void failure(Throwable t) {
                    Log.e(TAG, "Failure to Load Core Static Library: " + t.getMessage());
                }
            });