我正在使用AWS AppSync服务,该服务使用Mqtt Service library,
在Android 8(Google Pixel)上,当我启动该应用程序时,它崩溃了:
java.lang.RuntimeException: Error receiving broadcast Intent
{ act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) }
in org.eclipse.paho.android.service.MqttService$NetworkConnectionIntentReceiver@fdb4f10
...
Caused by: java.lang.SecurityException: Neither user 10548
nor current process has android.permission.WAKE_LOCK.
这很奇怪,因为清单中我有那个权限:
<uses-permission android:name="android.permission.WAKE_LOCK"/>
有人遇到过同样的问题吗?