breautek commented on PR #262: URL: https://github.com/apache/cordova-plugin-media-capture/pull/262#issuecomment-1712978978
> @PabbleDabble I also ran into this exact scenario. We include cordova-plugin-camera which requests WRITE_EXTERNAL_STORAGE permissions... without the maxSdkVersion qualifier. AndroidManifest.xml includes the following entries after plugin installs... > > cordova-plugin-camera > > > ``` > > <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> > > ``` > > cordova-plugin-media-capture > > > ``` > > <uses-permission android:maxSdkVersion="32" android:name="android.permission.READ_EXTERNAL_STORAGE" /> > > <uses-permission android:maxSdkVersion="32" android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> > > ``` > > The maxSdkVersion qualifier foils the manifest merge process and the build throws up an error... > > > Task :app:processReleaseMainManifest FAILED > > /Users/jmelvin/dev/sizzlescene/repos/mobile/platforms/android/app/src/main/AndroidManifest.xml:47:5-108 Error: > > Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:47:5-108 duplicated with element declared at AndroidManifest.xml:26:5-81 > > From a pending PR, the temporary workaround is to manually remove the maxSdkVersion qualifier before the cordova build. See SO post I made before seeing this comment... > > https://stackoverflow.com/questions/77074389/duplicate-write-external-storage-permissions-in-androidmanifest-using-cordova-12 I posted an answer on SO, but cross-posting here, I have a gist that will clean extra `WRITE_EXTERNAL_STORAGE` permissions. It can be used as a `after_prepare` hook: https://gist.github.com/breautek/bd157b8598f9a816f2ec0d45e3d932c8 A more detailed answer on that topic can be found at https://stackoverflow.com/a/77078295/4685664 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
