LoginSignup
30
28

More than 5 years have passed since last update.

Android5.0で`Failure [INSTALL_FAILED_DUPLICATE_PERMISSION perm=com.app.name.permission.C2D_MESSAGE pkg=com.app.name]`と表示されたときの対応

Posted at

しょうもないところでハマったのでメモ。

Android5.0にしてから開発版と製品版が同居できなくなった!と思ったら↑が原因だと思います。

対応

Manifestファイルに書いてるパッケージ名が重複していることが原因なので、${applicationId}に置き換えてやれば大丈夫って話です。

こんな感じ

AndroidManifest.xml
<receiver
    android:name=".gcm.GcmBroadcastReceiver"
    android:permission="com.google.android.c2dm.permission.SEND">
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE"/>
            <category android:name="${applicationId}"/>
        </intent-filter>
</receiver>

<permission
    android:name="${applicationId}.permission.C2D_MESSAGE"
    android:protectionLevel="signature"/>
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
30
28
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
30
28