Search Issue Tracker
Fixed in 2022.1.X
Votes
0
Found in
2019.4
2020.3
2020.3.13f1
2021.1
2021.2
2022.1
Issue ID
1351809
Regression
No
AndroidJavaProxy fails to proxy "java9.util.function.BiConsumer" class when special types are passed as arguments
AndroidJavaProxy fails to proxy "java9.util.function.BiConsumer" when special types - String, Boolean, etc. are passed as arguments
Reproduction steps:
1. Unzip file "bug-repro-project.zip", go to UnityProject folder and open the project inside
2. Build and run on Android device
3. Start logcat
4. Open the application and click on the color change buttons
Expected result: CSharpBiConsumer class with AndroidJavaProxy implemented from java9.util.function.BiConsumer accepts special types (String, Boolean, etc.) as of AndroidJavaObject result, AndroidJavaObject throwable parameters
Actual result: CSharpBiConsumer class with AndroidJavaProxy implemented from java9.util.function.BiConsumer fails to accept special types (String, Boolean, etc.) as of AndroidJavaObject result, AndroidJavaObject throwable java9.util.function.BiConsumer parameters
Reproducible with: 2019.4.30f1, 2020.3.19f1, 2021.1.23f1, 2021.2.0b13, 2022.1.0a11
Tested with:
VLNQA00332, Samsung Galaxy XCover4 (SM-G390F), Android 9, CPU: Exynos 7 Quad 7570, GPU: Mali-T720
VLNQA00004, Meizu MX5 (MX5), Android 5.0.1, CPU: MediaTek Helio X10 MT6795T, GPU: PowerVR Rogue G6200
VLNQA00099, Google Pixel XL (Pixel XL), Android 10, CPU: Snapdragon 821 MSM8996 Pro, GPU: Adreno (TM) 530
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "IndexOutOfRangeException" and "NullReferenceException" are thrown and Element disappears from UI Builder when undoing rename of element in "Open Instance in Context" menu
- Select Scriptable Object window freezes and becomes unresponsive when currently opened UXML Template is selected for binding's Data Source
- [Linux] “ReleaseButton expects buttonId >= 0” error is thrown when importing Assets via drag and drop
- Asset gets unselected and added Subgraphs list item is not undone when performing Undo in Heatmap with Default Values asset Inspector
- Black square “shadow” artifacts visible when using Screen Space Reflections without maximum smoothing
Resolution Note (fix version 2022.1):
Two things here:
1. The repro project is invalid. It fails to find java9.util.function.BiConsumer and number '9' is removed from class name then it also fails to find other Java class it uses for testing.
2. In any case it works as expected: AndroidJavaProxy by default searches for C# method with a matching signature. However, you can have a full control by overriding this method: https://docs.unity3d.com/2021.2/Documentation/ScriptReference/AndroidJavaProxy.Invoke.html