Application Crashes due to java.lang.SecurityException:

Today i check i received daily 30+ crashes per days and i checked in google play console showing this

java.lang.SecurityException: 
  at android.os.Parcel.readException (Parcel.java:2013)
  at android.os.Parcel.readException (Parcel.java:1959)
  at HT.a (SourceFile:194)
  at GF.a (SourceFile:28)
  at GJ.run (SourceFile:10)
  at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:457)
  at java.util.concurrent.FutureTask.run (FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
  at Oe.run (SourceFile:5)
  at java.lang.Thread.run (Thread.java:764)

here is one more

java.lang.SecurityException: 
  at android.os.Parcel.readException (Parcel.java:1718)
  at android.os.Parcel.readException (Parcel.java:1671)
  at com.google.android.gms.common.internal.s.r (Unknown Source)
  at com.google.android.gms.common.internal.W.u (Unknown Source)
  at com.google.android.gms.common.api.internal.At.q (Unknown Source)
  at com.google.android.gms.common.api.internal.rt.run (Unknown Source)
  at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:428)
  at java.util.concurrent.FutureTask.run (FutureTask.java:237)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607)
  at com.google.android.gms.internal.ef.run (Unknown Source)
  at java.lang.Thread.run (Thread.java:760)

You cannot have “java.*” package names. This is actually hard-coded in the Java core so you cannot even grant a security manager permission to work around it. Please check if your app package name contains ‘java’ or not.

How to i check my package name contains ‘java’

On screen1, scroll the the right side menu, you will find the Package Name. Search Carefully :wink:

1 Like

but using package name how i know is contain java or not

this is my package name :com.myname.firstname_lastname

Okay. So, does your app asks for any permission? Because these errors raise when you don’t handle the permission carefully.

1 Like

yes location permission. i asked for permission when home screen initialize

Can you please show the blocks where you are asking for permission?

yes please check below screenshot

If Location Permission is important for your app, then you can do as follows:

i) If Permission Granted, then open another screen. (Don’t use true or false with this block because this block always returns boolean value.)

ii) If ‘Permission Denied’, then close the app.

2 Likes

it’s not important it’s for admob interstitial ads.

can you tell me how i ask this permission and if denied what i do next

Do as follows.


:wink:

1 Like

ok i will try and thanks for help.

1 Like

Hello,
i found today this new crashes.

java.lang.IllegalThreadStateException: 
  at java.lang.Thread.checkNotStarted (Thread.java:849)
  at java.lang.Thread.start (Thread.java:1059)
  at com.onesignal.OneSignalPrefs$WritePrefHandlerThread.startThread (OneSignalPrefs.java:201)
  at com.onesignal.OneSignalPrefs$WritePrefHandlerThread.startDelayedWrite (OneSignalPrefs.java:142)
  at com.onesignal.OneSignalPrefs$WritePrefHandlerThread.access$200 (OneSignalPrefs.java:125)
  at com.onesignal.OneSignalPrefs.startDelayedWrite (OneSignalPrefs.java:282)
  at com.onesignal.OneSignal.setAppContext (OneSignal.java:607)
  at com.onesignal.RestoreKickoffJobService.startProcessing (RestoreKickoffJobService.java:15)
  at com.onesignal.OneSignalJobServiceBase$1.run (OneSignalJobServiceBase.java:22)
  at java.lang.Thread.run (Thread.java:818)

I think you have used Clock component and One Signal component and did something wrong with those blocks. :thinking:

i used in screen 1 one signal but not used clock in home screen. but i used clock in other all screen.

and about the block i not used any block of one signal and for clock i used only 3 block set timer enable to true falls and when timer

This error means that a thread has been started again after a complete execution. Your main thread has been started twice and it is not a good practice.

Any solution ?

i receive today Today, 8:18 PM on this ANRs

Broadcast of Intent { act=android.intent.action.SCREEN_OFF flg=0x58200010 }

(no location available)