Search Issue Tracker

By Design

Votes

0

Found in

2021.3.30f1

Issue ID

UUM-48688

Regression

No

[Quest 2][Android] AndroidJNI interop NullReferenceException when extending Android Activity with Vuplex Custom Plugin in AndroidManifest

--

-

Steps to reproduce:
1. Open the attached user's project "VuplexJNIFailed.zip"
2. Build for Quest 2
3. Connect Android Logcat
4. Observe the NullReferenceException in Android logcat

Expected results: AndroidJNI interop NullReferenceException is not outputted when extending Android Activity with Vuplex Custom Plugin in AndroidManifest
Actual results: AndroidJNI interop NullReferenceException when extending Android Activity with Vuplex Custom Plugin in AndroidManifest

Reproducible with: 2021.3.30f1
Could not test on 2022.3.9f1, 2023.1.12f1, 2023.2.0b9, 2023.3.0a5 due to "java.lang.RuntimeException: Unable to instantiate activity" on Quest 2

Reproducible on these devices:
VLNQA00415 - Oculus Quest 2 (Quest 2), CPU: Snapdragon XR2, GPU: Adreno 650, OS: 10

Could not test on these devices due to "java.lang.RuntimeException: Unable to instantiate activity":
N/A, Samsung Galaxy Note9 (SM-N9600), Android 9, CPU: Snapdragon 845 SDM845, GPU: Adreno (TM) 630
N/A, Xiaomi - (Redmi Note 8 Pro), Android 9, CPU: MediaTek Helios G90T MT6785T, GPU: Mali-G76 MC4
N/A, Google Pixel 3 (Pixel 3), Android 12, CPU: Snapdragon 845, GPU: Adreno (TM) 630
N/A, Samsung - (SM-G991U), Android 12, CPU: Snapdragon 888, GPU: Adreno (TM) 660

Reproducible on: Windows 10
Not reproducible on: No other environment tested

Notes:
-Issue does not reproduce when setting Custom Main AndroidManifest.xml and performing a build
-The Vuplex Plugin developer noted that it's an issue with Unity's JNI interop due to Manifest being overridden
-Additional Customer notes can be found in the attached "vuplexjnifailed.pdf" file
The customer noted that it's possible to reproduce without Oculus Integration and other XR Plugins, however I was unsuccessful
-Error:
NullReferenceException: Object reference not set to an instance of an object.
at UnityEngine.AndroidJNIHelper.CreateJavaProxy (UnityEngine.AndroidJavaProxy proxy) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.AndroidJavaProxy.GetRawProxy () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine._AndroidJNIHelper.CreateJNIArgArray (System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.AndroidJavaObject._AndroidJavaObject (System.String className, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0
at Vuplex.WebView.AndroidWebView._initAndroid3D (System.Int32 width, System.Int32 height, UnityEngine.AndroidJavaObject popupResultMessage) [0x00000] in <00000000000000000000000000000000>:0
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000

  1. Resolution Note:

    Based on stack trace JNI is called from other thread.
    When calling JNI, a thread must first be attached to JNI by calling this: https://docs.unity3d.com/2023.3/Documentation/ScriptReference/AndroidJNI.AttachCurrentThread.html

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.