Error -505 INSTALL_FAILED_DUPLICATE_PERMISSION: - android

I am working on a android VOIP Dialer. I unable to install my current app along with old app in a device.
01-07 12:05:05.115: E/Finsky(28214): [1] PackageInstallerImpl$2.onReceive: Error -505 while installing com.current.app: INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.current.app attempting to redeclare permission android.permission.CONFIGURE_SIP already owned by com.old.app
the permission in manifest.
<permission
android:name="android.permission.CONFIGURE_SIP"
android:permissionGroup="android.permission-group.COST_MONEY"
android:protectionLevel="signature" />
I have tried protectionLevel both signature and dangerous.
How can I solve this issue.

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.

Related

How to migrate an app in flutter from android 12 to android 13?

I need to migrate my application from android 12 to android 13 since in android 12 it does not show any errors, however when testing the app on a device with android 13 it gives me the following error:
[MethodChannelFilePicker] Platform exception:
PlatformException(read_external_storage_denied, User did not allow
reading external storage, null, null).
I've tried adding validations in the manifest, like the ones in:
I have also tried adding these validations in the main:
Add the following permission in your manifest.xml inside
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
If it still does not work out, upgrade or change the package you use for picking files and check the documentation.
recommended : https://pub.dev/packages/file_picker/versions/5.2.5

install failed due to duplicate permission

I'm trying to install the app on my Samsung M31s phone, but every time I'm getting the following error -
Error: INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.glance.tv.internal attempting to redeclare permission glance.sdk.api.status.permission.READ already owned by com.samsung.android.dynamiclock'
Is there any way to bypass this permission?
I tried removing it from the manifesto, but it is still not working.
<permission
android:name="com.glance.PERMISSION_READ"
android:protectionLevel="normal" />

Unable to install apk Error Code: -505

I have research a lot on here and google but could not find the solution. I have uploaded an app on play store and it was working fine then i developed an other application by making changes in previous app project and changed project id in build.gradle script and version code. Now if any of two application is installed in phone 2nd one always gives error code -505. Please help me, my both apps are live on playstore.
I have found my mistake and i am sharing it here as a answer if anyone else face this problem. I am using google maps in both applications and I use static package name in manifest for MAPS.RECIEVE permission and I complete forgot to change that package name. I was using following code
<permission
android:name="com.myapp.packagename.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
Correct one is
<permission
android:name="${applicationId}.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

ACCESS_WIFI_STATE error on emulator

I've declared the following permission on the manifest:
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
And per the docs it's a normal permission so no need to request it at runtime on devices running Android M or higher.
The app has crashed but I've tested on multiple devices (with android N) and the app works has expected. Any idea why it has crashed on an emulator with Android SDK built for x86 running android 7.0?
Here is the stacktrace:
Fatal Exception: java.lang.SecurityException: WifiService: Neither user 10076 nor current process has android.permission.ACCESS_WIFI_STATE.
at android.os.Parcel.readException(Parcel.java:1683)
at android.os.Parcel.readException(Parcel.java:1636)
at android.net.wifi.IWifiManager$Stub$Proxy.getWifiEnabledState(IWifiManager.java:1198)
at android.net.wifi.WifiManager.getWifiState(WifiManager.java:1455)
at android.net.wifi.WifiManager.isWifiEnabled(WifiManager.java:1467)
...
To work with WifiManager when scanning the Connections from Android 6.0 it needs to access your location, so that is either the fine location or the coarse location, Add the following to Manifes.xml:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Since Android M (6+) you have to ask the user for permissions during runtime, like iOS-applications for instance.
You can read the docs here, a quick solution is to use a library, e.g EasyPermission or EasyPermission
https://github.com/jineshfrancs/EasyPermission
https://github.com/lalosoft/EasyPermissions
Usage:
easyPermission.requestPermission(this, Manifest.permission.ACCESS_WIFI_STATE);

Unity can not Build on Android:java.lang.IllegalArgumentException: already added: Manifest$permission (UNEXPECTED TOP-LEVEL EXCEPTION)

When I have
----Plugins/Android/{res, jar….}
----Plugins/Android/AndroidManifest.xml
It's OK
When I have Facebook and Google+
----Plugins/Android/{res, jar….}
----Plugins/Android/facebookSDK folder
----Plugins/Android/google-play-services_lib (google+)
----Plugins/Android/BaseGameUtils (google+)
----Plugins/Android/MainLibProj (google+)
----Plugins/Android/AndroidManifest.xml
Can not Build to Android, getting error:
UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException:
already added: L …. /Manifest$permission;
It's because of this line on AndroidManifest.xml
<permission android:name="{my package}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
When I remove this permission, I can build and run, but can not get Push Notification (lack of permission).
Question: How can I keep this permission on Unity?
Finally, I solved this issue.
When you build your ----Plugins/Android/{ jar….} (your own project). Don't add any permission on AndroidManifest.
And then add that permission on ----Plugins/Android/AndroidManifest.xml. Good luck!

Categories

Resources