Recently I have dealt with some installation-issues for an android app:
1st failure, duplicate permission
11-26 17:39:40.730 10166-10166/? E/Finsky: [1] PackageInstallerImpl$2.onReceive: Error -505 while installing com.something.else: INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.something.else attempting to redeclare permission com.something.else.permission.C2D_MESSAGE already owned by com.something.else
11-26 17:39:40.730 10166-10166/? W/Finsky: [1] InstallerTask$3.installFailed: Install failure of com.something.else: -505 null
: This is probably due to an install of the same application on a different profile on your phone. Either make the user uninstall the app for ALL profiles on the phone or rename your C2D permission. This can be done without breaking the gcm-funcitonality by adding a middle-fix between your application-id and C2D_MESSAGE. In my case I renamed "com.something.else.permission.C2D_MESSAGE" to "com.something.else.permission
.e.C2D_MESSAGE"
2nd failure, gms bug
W/PackageManager(1007): com.android.server.pm.PackageManagerException: Can't install because provider name com.google.android.gms.measurement.google_measurement_service (in package com.something.else) is already used by com.quoord.tapatalkpro.activity
: add applicationId to the main flavour of your build. Even if it is defined in AndroidManifest.xml, other libraries just reads the build.gradle file. If it is empty it will clash with other applications doing the same thing.
3rd failure, same name as provider in other(random) app
INSTALL_FAILED_CONFLICTING_PROVIDER.
: change authorities of your provider since it has the same authority as a random other app you have installed. E.g. add ${applicationId} as a prefix to your authorities where you declare your provider in the manifest like this:
provider
android:name=".something.CommonManager"
android:authorities="${applicationId}.commonmanager"
android:readPermission=".commonmanager.read"
android:writePermission=".commonmanager.write" /