2

サービスを含むメイン アプリと、そのサービスを利用する 2 つ目のアプリがあります。

メインアプリのマニフェストにはこれがあります(アクティビティ内ではありません):

<service
    android:name="com.example.foo.XMPPService"
    android:exported="true"
    android:process="xmppService" />

2 番目のアプリでは、バインドしようとしています。

Intent intent = new Intent();
intent.setClassName("com.example.foo", "com.example.foo.XMPPService");
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);

しかし、私はエラーが発生します:

Unable to start activity ComponentInfo{com.example.app2/com.example.app2.MainActivity}: java.lang.SecurityException: Not allowed to bind to service Intent { cmp=com.example.foo/.XMPPService }

「エクスポート」をtrueに設定しているのに、なぜこれが許可されないのか疑問に思っています。

4

1 に答える 1