
我的应用已经< uses-permission android:name =“androID.permission.WAKE_LOCK”/>添加到AndroidManifest.xml.但是,获取锁定PowerManager.PARTIAL_WAKE_LOCK的调用会使Oreo设备上的应用程序崩溃.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: java.lang.SecurityException: Neither user 10094 nor current process has androID.permission.WAKE_LOCK.解决方法:
您的应用可能正在使用新版本的ACRA库.在新版本中,他们添加了< uses-permission androID:name =“androID.permission.WAKE_LOCK”androID:maxsdkVersion =“25”/>到lib AndroIDManifest.xml文件. androID:maxsdkVersion =“25”默默地合并到主app AndroIDManifest.xml文件,因此该应用程序在Oreo设备上没有WAKE_LOCK权限.解决方案是添加工具:node =“replace”到您的uses-permission声明.
例如< uses-permission androID:name =“androID.permission.WAKE_LOCK”工具:node =“replace”/>.
更新:在ACRA库的最新版本中,不幸的“功能”已经是removed.
总结以上是内存溢出为你收集整理的在Android 8 Oreo上无法获得WAKE_LOCK权限全部内容,希望文章能够帮你解决在Android 8 Oreo上无法获得WAKE_LOCK权限所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)