Search Issue Tracker

Fixed in 2.2.2

Votes

1

Found in [Package]

2.1.4

Issue ID

1308460

Regression

No

[UDP] Initialization fails when running the UDP Sample Project in Editor

Package: Unity Distribution Portal

-

Initialization fails for the Sample Project in Editor and Exception: JNI: Init'd AndroidJavaObject appears. The sample project is available with the Package.

Preconditions:
Requires Client ID from UDP dashboard or a project with UDP setup

Steps to repro:
1. Create a new Project
2. Window > Package Manager > Packages: Unity Registry
3. Search and Install UDP Package
4. Install UDP sample project from UDP package
5. Window > Unity Distribution Portal > Settings
6. Use existing project ID or Create a new one
7. Link Client ID
8. Project window > Open UDPSampleScene
9. Play the scene
10. Click Init button in the Game window
11. Click Buy button in the Game window

Actual Result:
Exception: JNI: Init'd AndroidJavaObject with null ptr! The error appears in Console. The debug log for Init success appears, however on clicking buy it displays the message to initialize first.

Expected Result:
The user is able to test the IAP through the editor or a message show to tell the user to deploy it on the device for testing and Exception is handled for the platform.

Note: The sample package was introduced in UDP package version 2.1.4

Reproducible on: 2021.2.0a3, 2021.1.0b4, 2020.2.2f2, 2019.4.19f1

UDP Package Version: 2.1.4

Environment: Windows 10

Stack Trace:
Exception: JNI: Init'd AndroidJavaObject with null ptr!
UnityEngine.AndroidJavaObject..ctor (System.IntPtr jobject) (at <1e67f596cfda4a0b8077522fd46f3947>:0)
UnityEngine._AndroidJNIHelper.GetSignature (System.Object obj) (at <1e67f596cfda4a0b8077522fd46f3947>:0)
UnityEngine._AndroidJNIHelper.GetSignature (System.Object[] args) (at <1e67f596cfda4a0b8077522fd46f3947>:0)
UnityEngine._AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.Object[] args, System.Boolean isStatic) (at <1e67f596cfda4a0b8077522fd46f3947>:0)
UnityEngine.AndroidJNIHelper.GetMethodID (System.IntPtr jclass, System.String methodName, System.Object[] args, System.Boolean isStatic) (at <1e67f596cfda4a0b8077522fd46f3947>:0)
UnityEngine.AndroidJavaObject._CallStatic (System.String methodName, System.Object[] args) (at <1e67f596cfda4a0b8077522fd46f3947>:0)
UnityEngine.AndroidJavaObject.CallStatic (System.String methodName, System.Object[] args) (at <1e67f596cfda4a0b8077522fd46f3947>:0)
UnityEngine.UDP.StoreService.LicenseCheck (UnityEngine.UDP.ILicensingListener licensingListener) (at <82079fb47bf9417ba4b0456b93ff4381>:0)
UDPSampleScript.LicenseCheck () (at Assets/Samples/Unity Distribution Portal/2.1.4/UDP sample/Scripts/UDPSampleScript.cs:56)
UDPSampleScript.Start () (at Assets/Samples/Unity Distribution Portal/2.1.4/UDP sample/Scripts/UDPSampleScript.cs:50)

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.