Aidl causes an abnormal cause Android java.lang.SecurityException:Binder invocation to an incorrect interface

Source: Internet
Author: User

I have built two project. One is activity, one is service.

There are a few things to note when you are doing two project communications:
1. In activity project, introduce the Aidl file in service project. Note the introduction of the Aidl file package name should be consistent with the Aidl file package name in the service.
2.service project in manifest file, service registration to declare android:process= ": Remote"
The action should be the package name of the interface in the Aidl. Interface name.

3.activity Bindservice A Serviceconnection object corresponds to a service, otherwise it will be reported java.lang.SecurityException:Binder invocation to an Incorrect interface exception.


Additions to the 1th


For example, you originally established a com.abc.service.test.aidl in the service


So you have to create a com.abc.service.test.adil in the Activity that you want to communicate. Do not put Test.adil directly in your activity package, re-see a package, the package name is Com.abc.service and then put the test.aidl into the finished

Aidl causes an abnormal cause Android java.lang.SecurityException:Binder invocation to an incorrect interface

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.