Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.SecurityException Neither user 10145 nor current process has android.permission.WAKE_LOCK

Tags:

android

My app has added this permission , but in some device has this error message, all in android 4.4(4.4.2)

java.lang.SecurityException Neither user 10145 nor current process has android.permission.WAKE_LOCK.

like image 726
2356 Maf Avatar asked Dec 14 '22 01:12

2356 Maf


2 Answers

If You Are Using Acra Library Check This Answer :

https://stackoverflow.com/a/50972790/7377631

Your app is probably using a new version of ACRA library. In new the version they added to the lib AndroidManifest.xml file. The android:maxSdkVersion="25" is silently merged to main app AndroidManifest.xml file, hence the app doesn't have WAKE_LOCK permission on Oreo devices. The solution is add tools:node="replace" to your uses-permission declaration.

For example <uses-permission android:name="android.permission.WAKE_LOCK" tools:node="replace"/>.

like image 126
Meisam Avatar answered May 19 '23 03:05

Meisam


Android permissions are case sensitive. So check whether you have added the permission correctly.

<uses-permission android:name="android.permission.WAKE_LOCK"/>

Also there is a known bug in Marshmallow. So try building by changing your targetsdk version is it is Android 6.0.

like image 32
Febi M Felix Avatar answered May 19 '23 03:05

Febi M Felix