0 votes
by (120 points)
edited by

Unity 2020.3.30f1
PicoXR Plugin 1.2.4
PUI 4.0.7

Hi all,

im trying to update the screen off delay property following the docs.

In PXR_System.cs there is an InitSystemService method which is calling


what is it for?

This call results a crash for me.

If Im commenting out this line the service initialization call seems to run fine, but after that when i try to bind the service with


im getting a

AndroidJavaException: java.lang.NullPointerException: Attempt to
invoke virtual method 'java.lang.String
android.content.Context.getPackageName()' on a null object reference

Which refers to a line

at com.pvr.tobservice.ToBServiceHelper.bindTobService(ToBServiceHelper.java:65)

Why am I getting null for the context here?



2 Answers

0 votes
by (5.3k points)

What`s your PUI version? System API needs PUI version 3.11.3 and above on G2 4k. As you can see in their docs.

by (120 points)

PUI version is 4.0.7

by (5.3k points)

you can try initialize System Service in a second like this
enter image description here

by (120 points)

thanks, but unfortunately delaying the call does not solve the issue

0 votes
by (27.7k points)

Dear developer,
Could you please provide a Demo project or apk that can reproduce this problem?
And could you please provide these information, equipment type, PUI version, Unity version and SDK version in your mail.
Please send it to our email: pico_devanswers@bytedance.com.
We'll test it.
And please use the title of your question as the subject of your email.

by (27.7k points)
edited by

Dear developer
You can try to create a new empty gameobject and add this script on it.
or https://github.com/WinterZmorgen/System-Api.git