解决使用aidl时出现java.lang.SecurityException Binder invocation to an incorrect interface的问题

如果在使用aidl时出现java.lang.SecurityException: Binder invocation to an incorrect interface异常,原因可能是客户端跟服务器的aidl包名不一致。
如果包名确认一致了,还是报这个异常的话,那有可能是客户端app进行了代码混淆,在proguard-rules.pro中添加此包名忽略掉混淆,例如:
-keep public class com.test.aidl.**{*;}
 

猜你喜欢

转载自blog.csdn.net/chenzhengfeng/article/details/104268260