Installation failed with message INSTALL_FAILED_DUPLICATE_PERMISSION… C2D_MESSAGE possibilities
@commonsware blogs has explain it in details in Custom Permission Vulnerability and the 'L' Developer Preview:
Near as I can tell, the “L” Developer Preview requires that all apps
with a<permission>
element for the same android:name value be signed
by the same signing key. The actualprotectionLevel
or other values
inside the<permission>
does not matter. Even if they are identical, an
app trying to define the<permission>
will fail to install if an
existing installed app already defines the<permission>
. Specifically,
the installation of the second app will fail with an
INSTALL_FAILED_DUPLICATE_PERMISSION error.
Here the answer from @commonsware: https://stackoverflow.com/a/11730133/4758255
Error -505 INSTALL_FAILED_DUPLICATE_PERMISSION:
It seems you are trying to declare same permission in two applications.
In order to keep both application installed, common solution for this problem is to use a dynamic prefix for your permission, preventing conflicts with other apps (as it happens for GCM configuration too):
<permission
android:name="${applicationId}.permission.CONFIGURE_SIP"
android:permissionGroup="${applicationId}.permission-group.COST_MONEY"
android:protectionLevel="signature" />
Be careful to have applicationId
value assigned in your Gradle configuration under android > defaultConfig
.
C2D_message is not unique while trying to make sign apk
You may refer with this post.
Remove
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>
Run App then add the
permisson
again and Run App.
This problem often occurs when you try to install debug and release version of your app on the same device.
INSTALL_FAILED_DUPLICATE_PERMISSION error when installing Yahoo Mail apk on Samsung Galaxy S6 using Appium
On Android 5.0+, two apps cannot have the same <permission>
element, creating the same permission, unless they are signed by the same signing key. In your case, the Galaxy S6 already has something that defined this permission, and it has a different signing key than the one that somebody used to sign your APK.
Related Topics
How to Send and Receive Data Sms Messages
How to Retrieve the Android Sdk Version
Usb Device Access Pop-Up Suppression
Firebase (Fcm): Open Activity and Pass Data on Notification Click. Android
How to Get All Android Contacts But Without Those Which Are on Sim
Passing String Array Between Android Activities
Location Service Gps Force Closed
Android Eclipse Ddms - Can't Access Data/Data/ on Phone to Pull Files
Vectordrawable - Is It Available Somehow for Pre-Lollipop Versions of Android
Emulator Error: This Avd's Configuration Is Missing a Kernel File
Android Webview App Won't Let Video Player Go Full Screen
Upload Photo to Facebook with Facebook Android Sdk in Android
How to Write Vertically in a Textview in Android
Android/Webkit Text-Overflow: Ellipsis Not Working