错误Binder invocation to an incorrect interface

wrong description

When practicing AIDL, I encountered the following error:

java.lang.SecurityException: Binder invocation to an incorrect interface

Cause Analysis

According to the error message, it should be caused by the inconsistency of AIDL at both ends. Check the AIDL codes at both ends of the client and server, and no problem is found.
Then check the file location of AIDL, and find that the two ends of the client and server are inconsistent, and the package names of the two AIDL are inconsistent:

Client:
Client location.jpg

Server:
Server location.jpg

Solution

Unify the package names of the two as com.example.workdemo2, and then re-run to find that the problem has been solved.

Guess you like

Origin blog.csdn.net/cat_is_so_cute/article/details/122600528