java.lang.SecurityException: Not allowed to bind to service Intent { act=com.android.testAIDLServic

时间:2022-10-12 00:26:18

在测试AIDL服务的时候,出现

  java.lang.SecurityException: Not allowed to bind to service Intent { act=com.android.testAIDLService.MyService,这个错误,就是绑定不了这个服务

 解决办法:

    添加代码:

    //////////////////////////////////////////////////////////

    android:process=":remote"
    android:exported="true,设置此属性为true,否则出现

    ///////////////////////////////////////////////////////////


<service android:name="com.android.hisense.testaidlService.MyService"  
                 android:exported="true"
                  >
            <intent-filter>
                <!--是客户端用于访问AIDL服务的ID  -->
                <action android:name="com.android.hisense.testaidlService.IMyService" />
            </intent-filter>
</service>