复现步骤:
1. 编译条件
compileSdkVersion 34
targetSdkVersion 34
2.错误日志:
2024-05-10 20:47:53.419 27949-27988 OpenGLRenderer io.agora.api.example E Unable to match the desired swap behavior.
2024-05-10 20:47:55.950 27949-27949 AudioRecord io.agora.api.example E createRecord_l(0): AudioFlinger could not create record track, status: -1
2024-05-10 20:47:55.950 27949-27949 AudioRecord-JNI io.agora.api.example E Error creating AudioRecord instance: initialization check failed with status -1.
2024-05-10 20:47:55.951 27949-27949 android.me...udioRecord io.agora.api.example E Error code -20 when initializing native AudioRecord object.
2024-05-10 20:47:55.961 27949-28006 AndroidRuntime io.agora.api.example E FATAL EXCEPTION: pool-5-thread-1
Process: io.agora.api.example, PID: 27949
java.lang.SecurityException: io.agora.api.example: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
3.设备: 魅族 20 Pro。
可能最新Android系统的设备都有这个问题。
4.其它
(1)32编译, 没有这个问题。
(2)跟 AndPermission 有关系
java.lang.SecurityException: io.agora.api.example: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
先32用吧,34后续升级会修复