cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Piotrowski (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-12842) Two plugins with same provider make Android build crash
Date Tue, 23 May 2017 13:45:04 GMT
Jan Piotrowski created CB-12842:
-----------------------------------

             Summary: Two plugins with same provider make Android build crash
                 Key: CB-12842
                 URL: https://issues.apache.org/jira/browse/CB-12842
             Project: Apache Cordova
          Issue Type: Bug
          Components: cordova-android
         Environment: cordova-android 6.2.3
            Reporter: Jan Piotrowski


Installing two plugins (in the example https://github.com/apache/cordova-plugin-camera and
https://github.com/sitewaerts/cordova-plugin-document-viewer) can create something like this:

{code}
        <provider android:authorities="${applicationId}.provider" android:exported="false"
android:grantUriPermissions="true" android:name="android.support.v4.content.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"
/>
        </provider>
        <provider android:authorities="io.ionic.conferenceapp.DocumentViewerPlugin.fileprovider"
android:exported="false" android:grantUriPermissions="true" android:name="android.support.v4.content.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/documentviewer_file_paths"
/>
        </provider>
{code}

This causes the build to fail like so:

{code}
ionic cordova run android

UP-TO-DATE
:generateArmv7DebugResources UP-TO-DATE
:mergeArmv7DebugResources
 UP-TO-DATE

:processArmv7DebugManifest
C:\Users\mohan\Documents\PrimusGIT\MobileApps\Demo\platforms\android\AndroidManifest.xml:16:9-18:20
Error:
        Element provider#android.support.v4.content.FileProvider at AndroidManifest.xml:16:9-18:20
duplicated with element declared at AndroidManifest.xml:13:9-15:20


See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:processArmv7DebugManifest FAILED

C:\Users\mohan\Documents\PrimusGIT\MobileApps\Demo\platforms\android\AndroidManifest.xml Error:
        Validation failed, exiting


BUILD FAILED

Total time: 27.006 secs
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processArmv7DebugManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to
get more log output.
Error: cmd: Command failed with exit code 1 Error output:
C:\Users\mohan\Documents\PrimusGIT\MobileApps\Demo\platforms\android\AndroidManifest.xml:16:9-18:20
Error:
        Element provider#android.support.v4.content.FileProvider at AndroidManifest.xml:16:9-18:20
duplicated with element declared at AndroidManifest.xml:13:9-15:20
C:\Users\mohan\Documents\PrimusGIT\MobileApps\Demo\platforms\android\AndroidManifest.xml Error:
        Validation failed, exiting

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processArmv7DebugManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to
get more log output.


[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova run android (exit code 1).
{code}

How should this be handled?

Forum topic where the problem originated:
https://forum.ionicframework.com/t/ionic-plugin-document-viewer-creating-android-manifest-merger-issue-in-build/91297



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message