cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filip Maj (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-12492) plugin.xml edit-config not working for attributes on manifest/application
Date Thu, 23 Mar 2017 20:26:41 GMT

    [ https://issues.apache.org/jira/browse/CB-12492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15939170#comment-15939170
] 

Filip Maj commented on CB-12492:
--------------------------------

I can confirm that:

{noformat}
<edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
    <uses-sdk android:minSdkVersion="16" android:maxSdkVersion="23" />
</edit-config>
{noformat}

Works fine, but:

{noformat}
<edit-file file="AndroidManifest.xml" target="/manifest" mode="merge">
    <manifest xmlns:tools="http://schemas.android.com/tools"></manifest>
</edit-file>

<edit-file file="AndroidManifest.xml" target="/manifest/application" mode="merge">
    <application tools:replace="android:icon"></application>
</edit-file>
{noformat}

Does not work.

I think it may be that adding an {{xmlns}} to the top-level manifest tag is not working, and
that in turn prevents the next tag, {{<application>}}, to be added since it uses the
{{tools}} XML namespace.

Will dig further.

> plugin.xml edit-config not working for attributes on manifest/application
> -------------------------------------------------------------------------
>
>                 Key: CB-12492
>                 URL: https://issues.apache.org/jira/browse/CB-12492
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, CordovaCommon
>    Affects Versions: 2.0.0
>            Reporter: Matthias
>            Assignee: Filip Maj
>
> h3. Environment
> Cordova: 6.5.0
> CordovaCommon: 2.0.0
> CordovaAndroid: 6.1.2
> h3. Description
> Using the edit-config in a plugin.xml to add an additional attribute on the manifest
or application tag in AndroidManifest.xml does not work.
> h3. Steps to reproduce
> - Create new cordova project with android platform
> - (Copy initial AndroidManifest.xml for comparison)
> - Add cordova plugin which uses the edit-config setting to add a new attribute to manifest
or application tag
> - Compare updated AndroidManifist.xml and see attribute was not added
> h3. Expectation
> Edit-config setting in plugin.xml allows to add/alter as well attributes on manifest/application/...
level in AndroidManifest.xml
> ----
> h3. Example
> This will work
> {code:xml}
> <edit-config file="AndroidManifest.xml" target="/manifest/uses-sdk" mode="merge">
>     <uses-sdk android:minSdkVersion="16" android:maxSdkVersion="23" />
> </edit-config>
> {code}
> This will *NOT* work
> {code:xml}
> <edit-file file="AndroidManifest.xml" target="/manifest" mode="merge">
>     <manifest xmlns:tools="http://schemas.android.com/tools"></manifest>
> </edit-file>
> <edit-file file="AndroidManifest.xml" target="/manifest/application" mode="merge">
>     <application tools:replace="android:icon"></application>
> </edit-file>
> {code}



--
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