SocialSharing-PhoneGap-Plugin: Duplicate issue
Hey there, due to this commit my android build fails due to a duplicate <uses-permission>.
When I install the file-transfer plugin it adds this line to my AndroidManifest.xml.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
When I install the SocialSharing plugin it adds this line to my AndroidManifest.xml file.
<uses-permission android:maxSdkVersion="18" android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
When I run cordova build android I get this error.
:processDebugManifest/Users/Comfy-Blitz/Development/Unbill/mobile/platforms/android/AndroidManifest.xml:33:9 Error:
Element activity#com.facebook.LoginActivity at AndroidManifest.xml:33:9 duplicated with element declared at AndroidManifest.xml:21:9
/Users/Comfy-Blitz/Development/Unbill/mobile/platforms/android/AndroidManifest.xml:37:5 Error:
Element uses-permission#android.permission.WRITE_EXTERNAL_STORAGE at AndroidManifest.xml:37:5 duplicated with element declared at AndroidManifest.xml:36:5
/Users/Comfy-Blitz/Development/Unbill/mobile/platforms/android/AndroidManifest.xml:0:0 Error:
Validation failed, exiting
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed with multiple errors, see logs
So it looks like this plugin and file transfer plugin are fighting š Any help here?
About this issue
- Original URL
- State: open
- Created 9 years ago
- Comments: 22 (5 by maintainers)
Commits related to this issue
- Issue #295 works around problems with androids manifest merger by having an own FileProvider in the plugin see also: http://stackoverflow.com/questions/40746144/error-with-duplicated-fileprovider-in-m... — committed to houseboat/SocialSharing-PhoneGap-Plugin by deleted user 7 years ago
- Merge pull request #1 from houseboat/bugfix/295 Issue #295 works around problems with androids manifest merger by hav⦠— committed to houseboat/SocialSharing-PhoneGap-Plugin by wischweh 7 years ago
- Issue #295 adds FileProvider to plugin configuration — committed to houseboat/SocialSharing-PhoneGap-Plugin by deleted user 7 years ago
- Merge pull request #2 from houseboat/bugfix/295 Issue #295 adds FileProvider to plugin configuration — committed to houseboat/SocialSharing-PhoneGap-Plugin by wischweh 7 years ago
For Cordova 5.4.x manually change the file platforms/android/android.json (find all extra āandroid.permission.WRITE_EXTERNAL_STORAGEā and delete them) and rebuild app.
After scratching my head over this for 2 days, I finally switched to this plugin and things have worked well since then. cordova plugin add phonegap-plugin-barcodescanner Details: https://www.sitepoint.com/scanning-qr-code-cordova/ Note: cordova-plugin-barcodescanner kept giving errors in Android, but phonegap-plugin-barcodescanner worked.
Hey @ashishgupta301, itās pretty annoying but you have to open your
plugins/android.jsonand remove the duplicate keys in there. In your case, search forWRITE_EXTERNAL_STORAGEinandroid.jsonand remove any duplicates. Then open upplatforms/android/AndroidManifest.xmland remove any duplicate<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />. Then rebuild and try again.