apache / cordova-plugin-camera

Apache Cordova Plugin camera
https://cordova.apache.org/
Apache License 2.0
960 stars 1.52k forks source link

android.permission.WRITE_EXTERNAL_STORAGE conflicting with other plugins Version 7.0.0 #854

Closed geodatadev closed 8 months ago

geodatadev commented 8 months ago

Bug Report

Problem

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32" />

This tag is beeing duplicated on Android.xml and causing an error. Because other plugins such as cordova-plugin-file uses

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

What is expected to happen?

The build to go succefully.

What does actually happen?

On build, a duplication error on Android.xml is fired

Information

Command or Code

Environment, Platform, Device

Version information

Checklist

erisu commented 8 months ago

cordova-plugin-file@8.0.0 does not declare or use WRITE_EXTERNAL_STORAGE.

You are probably installing and older version of cordova-plugin-file. You should be using `cordova-plugin-file@8.0.0. It also supports Android 33 permissions.

Any other third-party, non-Apache Cordova, plugins that define WRITE_EXTERNAL_STORAGE and does not define the android:maxSdkVersion="32" should be updated. You should open an issue ticket on their repos.

Apache plugins that defined the WRITE_EXTERNAL_STORAGE have already been updated. Also, as a side note, if you using the file-transfer plugin, it was updated to remove the WRITE_EXTERNAL_STORAGE permission as well but currently in a release vote that should be out soon.

I don't have the link on me, but I noticed @breautek provided a hook script that will remove duplicate permissions, such as WRITE_EXTERNAL_STORAGE.

I am closing out this ticket as not an issue.

breautek commented 8 months ago

I don't have the link on me, but I noticed @breautek provided a hook script that will remove duplicate permissions, such as WRITE_EXTERNAL_STORAGE.

The gist is located at https://gist.github.com/breautek/bd157b8598f9a816f2ec0d45e3d932c8

Jahrenski commented 8 months ago

Just to help pinpoint the conflicting plugins, in my case this permission was conflicting between camera and cordova-plugin-nativeaudio

I forked the unmaintained nativeaudio plugin to match the same declaration of the permission usage as such :

No more conflict.

CaioMelo8 commented 7 months ago

I've encountered the same issue, but in my case I had both <uses-permission> and <uses-feature> duplicated due to conflicts between plugin.xml configurations.

For now, the best solution I found was using a simplified version of this hook found at cordova-plugin-ble-central.