'INSTALL_FAILED_DUPLICATE_PERMISSION when try to install the app

Ive wrote an app. Everthing was fine but then i wanted to work on it on my computer at home. The problem is that i receive the error message "INSTALL_FAILED_DUPLICATE_PERMISSION" when i want to start the app in the emulator. At work I use the same settings for the emulator. And there werent problems with other apps when i tried to work on it on 2 different computers.

Sorry if I havent gave u enough informations, but i am new in programming.

Maybe somebody have made similar experiences and could help me with it.

Thanks in Advance!



Solution 1:[1]

Check AndroidManifest.xml for duplicate permissions.

Have look at this : https://github.com/OneSignal/react-native-onesignal/issues/352

Solution 2:[2]

You can use the ${applicationId} on the place of packageName in AndroidManifest.xml file.

Replace

<permission
android:name="com.example.testapp.permission.C2D_MESSAGE"
android:protectionLevel="signature"/>

<uses-permission android:name="com.example.testapp.permission.C2D_MESSAGE"/>

to

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

And in receiver’s intent-filter: replace

<category android:name="com.example.testapp"/>

to

<category android:name="${applicationId}"/>

And DUPLICATE_PERMISSION issue will be resolved.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhammad Haseeb
Solution 2 Kamal Subhani