Application Crashes due to java.lang.SecurityException:

From the Android Documentation:

Security Exception is thrown by the security manager to indicate a security violation.

An example of security violation, is trying to accessing, reading or writing data in android, which your app isnā€™t allowed to access it by the android security manager possibly due on of the following:

  • Not declaring sufficient permissions
    Permissions are declared in the appā€™s manifest using the <uses-permission> tag. Almost all components and extensions do this already. But in case it doesnā€™t, you will need to decompile the APK or AAB and add it manually.
  • The protection level of one of the required declared permissions is dangerous, which means that the user must accept it in the runtime starting from Android 6 ( using the Screen. AskPermission block. ).
    Most of the components asks the user to accept the permission already, but itā€™s possible you will need to ask it using the mentioned blocks when using some components or extensions.
  • One of the features you use requires your app to be signed as a system app.

An example is:

  • Accessing the user location ( using the location sensor for example or Google Maps), without having the location permissions.
  • Accessing the internet without the internet permission.
  • Reading/Writing files from the deviceā€™s storage ( excluding app specific directories which apps have access to it by default )
    Well explained here.
  • And so onā€¦
1 Like

and what about this ?

recently i received this one more ANRs

executing service ā€œmy app package nameā€/com.onesignal.SyncJobService

com.onesignal.SyncJobService

1 Like

i confirm this. same issue is also happening in one of my apps.
i did not use location detection in app.
its working best in my infinix hot 8 android 9. but today i tested my app in oppo F1s android 5.1
then i faced the very same error.
the major componets i used are tiny db and web .
and all other are simple alighmnts buttons and lables along with dynamic components extension bt @yusufcihan
scrol handler by @colintree
taifun clipboard by @Taifun

1 Like

you might want to replace my extension by the built in Device Utilities component and its Copy/Paste methods


Taifun
1 Like

in my app only location permission and i am asking for this. no other permission in my app.

this ANRs i am facing in android 9

Yup i will
But in another app of mine with same configuration 100% same (but data is changed) everything is fine
I have an hypothesis not yet confirmed that tinydb might be the cause.
edit
Now i get confirmed details why its happening
Actually i have used perdiza sqlite extension thatā€™s now has become a component but when i created this app i was unaware of the fact that this extension is now a component so i imported that extension and used and later on i used another method to store data with tiny db and forget to remove that extension from my app

Now that extension is causing runtime exception issueā€¦ not security issue.

Detailed information is taken from play console and by some permanent users help.

1 Like

@Taifun actually this is not the solution for@jiks_devloper 's issue.
So i unmarked the solution.

ok, I understand, thank youā€¦
you also used this thread and meanwhile found your solution, which is greatā€¦ but @Jiks_Devloper actually had another problemā€¦

Taifun

2 Likes

Thank you @golumaths100
above 2 crashes now fixed .

but recently i received this new crashes please check.
tgkill

backtrace:
  #00  pc 000000000004aab8  /system/lib/libc.so (tgkill+12)
  #01  pc 0000000000048233  /system/lib/libc.so (pthread_kill+34)
  #02  pc 000000000001dca9  /system/lib/libc.so (raise+10)
  #03  pc 0000000000019341  /system/lib/libc.so (__libc_android_abort+34)
  #04  pc 00000000000173a8  /system/lib/libc.so (abort+4)
  #05  pc 000000000000c615  /system/lib/libcutils.so (__android_log_assert+112)
  #06  pc 00000000000edd01  /system/lib/libstagefright.so (android::MediaCodec::onMessageReceived(android::sp<android::AMessage> const&)+11104)
  #07  pc 000000000000f485  /system/lib/libstagefright_foundation.so (android::AHandler::deliverMessage(android::sp<android::AMessage> const&)+24)
  #08  pc 0000000000011715  /system/lib/libstagefright_foundation.so (android::AMessage::deliver()+60)
  #09  pc 000000000000ffff  /system/lib/libstagefright_foundation.so (android::ALooper::loop()+398)
  #10  pc 000000000000e4a5  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+264)
  #11  pc 000000000006a29d  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+80)
  #12  pc 0000000000047d03  /system/lib/libc.so (__pthread_start(void*)+22)
  #13  pc 000000000001a00d  /system/lib/libc.so (__start_thread+6)

These lines indicate that the error is occurring in the thread. May I ask you about all the components you are using in your app?

here is the all components list whose in my application.

This all components i used in home screen
Tiny_DB1
Sharing1
Notifier1
Activity_Starter1
Resource_Utilities1
Package_Utilities1
Push_Notifications1

this all components i used in all other screen
Clock1
Player1
Tiny_DB1
Resource_Utilities1
AdMob_Interstitial1
Notifier1

Note : in some screen i used 1 components 2 or more time like Notifier i used in 2 times and clock component i used in 6 times in some screen.

See, these two errors show that the OS is shutting down the app. You can read Diagnosing Native Crashes Ā |Ā  Android Open Source Project for more info and how to resolve these errors.

Also read this for further help: android - Native crashes on abort in developer console with Oreo (8.1) - Stack Overflow

Hope it will help you. :slight_smile:

Thank you :+1:t2:

1 Like

Hello

i found new crease from last 1 week without i update my application.

java.lang.RuntimeException

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3960)
  at android.app.ActivityThread.access$1400 (ActivityThread.java:268)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1993)
  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:1075)
Caused by: java.lang.ClassNotFoundException: 
  at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:196)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:379)
  at java.lang.ClassLoader.loadClass (ClassLoader.java:312)
  at android.app.AppComponentFactory.instantiateReceiver (AppComponentFactory.java:110)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:3953)

in my play console showing this

Hello,

any one know about this :thinking:

Are you using Firebase in your app? :thinking:

If yes, then use multiDexEnabled true; in your build.gradle. See here:

Go through this guide to know how to decompile APK and then edit your build.gradle(module: app)

1 Like

in my apk not firebase component but one signal is there