Android Question Error in B4A PreferenceActivity

In my calendar app PreferenceActivity is working perfectly previously in all android version and now working in android 4.3 but now (since I haven't changed any code related to PreferenceActivity) encountered following error while calling StartActivity(PrefScreen.CreateIntent) in android 10.
I have changed targetSdkVersion="28" and compiled with the same.

Logger connected to: samsung SM-M307F
--------- beginning of crash
--------- beginning of main
java.lang.RuntimeException: Unable to create service np.com.nareshmdr.nepalicalendar.starter: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4166)
at android.app.ActivityThread.access$1500(ActivityThread.java:268)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1998)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:164)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at np.com.nareshmdr.nepalicalendar.starter.onCreate(starter.java:34)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4154)
... 8 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at anywheresoftware.b4a.shell.ShellConnector.sendControlMessage(ShellConnector.java:61)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:124)
... 12 more
java.lang.RuntimeException: Unable to create service np.com.nareshmdr.nepalicalendar.starter: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4166)
at android.app.ActivityThread.access$1500(ActivityThread.java:268)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1998)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:164)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at np.com.nareshmdr.nepalicalendar.starter.onCreate(starter.java:34)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4154)
... 8 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io_OutputStream.write(byte[])' on a null object reference
at anywheresoftware.b4a.shell.ShellConnector.sendControlMessage(ShellConnector.java:61)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:124)
... 12 more
 
I tried logging in release mode as you said and when I tried to open settings activity calling StartActivity(PrefScreen.CreateIntent) in android 10 which caused the same error in Android 10 but still working properly upto Android 6.

Logger connected to: samsung SM-M307F
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
Downloaded: dataver.txt
** Activity (main) Pause, UserClosed = false **
--------- beginning of crash
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = anywheresoftware.b4a.objects.preferenceactivity$PreferenceScreenWrapper)
at android.os.Parcel.writeSerializable(Parcel.java:1850)
at android.os.Parcel.writeValue(Parcel.java:1797)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:945)
at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1584)
at android.os.Bundle.writeToParcel(Bundle.java:1253)
at android.os.Parcel.writeBundle(Parcel.java:1014)
at android.content.Intent.writeToParcel(Intent.java:11155)
at android.app.IActivityTaskManager$Stub$Proxy.startAppLockService(IActivityTaskManager.java:8468)
at android.app.Activity.startAppLockService(Activity.java:8950)
at android.app.Activity.performStart(Activity.java:8022)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3472)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Caused by: java.io.NotSerializableException: android.preference.PreferenceScreen
at java.io_ObjectOutputStream.writeObject0(ObjectOutputStream.java:1240)
at java.io_ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1604)
at java.io_ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1565)
at java.io_ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1488)
at java.io_ObjectOutputStream.writeObject0(ObjectOutputStream.java:1234)
at java.io_ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
at java.util.ArrayList.writeObject(ArrayList.java:762)
at java.lang.reflect.Method.invoke(Native Method)
at java.io_ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1036)
at java.io_ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1552)
at java.io_ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1488)
at java.io_ObjectOutputStream.writeObject0(ObjectOutputStream.java:1234)
at java.io_ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1604)
at java.io_ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1565)
at java.io_ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1488)
at java.io_ObjectOutputStream.writeObject0(ObjectOutputStream.java:1234)
at java.io_ObjectOutputStream.writeObject(ObjectOutputStream.java:354)
at android.os.Parcel.writeSerializable(Parcel.java:1845)
... 21 more
 
Upvote 0
Top