Record an error encountered in daily development: java. Lang. SecurityException: permission denial: startforeground from PID = 2345, uid = 10395 requires Android. Permission. Foreground_ SERVICE.
This error mainly appears on Android 9.0 phones, because Android 10 has no coverage
Solutions
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
The above error is due to Android 9.0’s new restrictions on permissions. This foreground service permission needs to be statically applied in the androidmanifest.XML
file. Adding the above permission code will not report an error
Similar Posts:
- Permissions required by Vibrator.vibrate: android.permission.VIBRATE
- Android Error: open failed: EACCES (Permission denied)
- About multi_ image_ Error reporting for picker
- Solution to the error of “may missing Internet permission” in Android
- Socket failed:EACCES(Permission denied) [How to Solve]
- OS Error: No address associated with hostname, errno = 7 [How to Solve]
- How to Remove Error: “Permission is only granted to system apps”
- Appium Error: An unknown server-side error occurred while pro…g\\\\npm\\\\node_modules\\\\appium\\\\node_modules
- [Solved] Git Bash error: could not lock config file Java/jdk1.7.0_71/.gitconfig: Permission denied