Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot insert new Item to the section on AndroidManifest #171

Open
WuglyakBolgoink opened this issue Dec 6, 2021 · 0 comments
Open

Cannot insert new Item to the section on AndroidManifest #171

WuglyakBolgoink opened this issue Dec 6, 2021 · 0 comments

Comments

@WuglyakBolgoink
Copy link

Bug report

Current behavior:

  • create new project
  • add cordova-android@latest platform
  • add cordova-plugin-camera@latest plugin
  • add cordova-custom-config@latest plugin
  • update config.xml
<custom-config-file parent="./queries" target="AndroidManifest.xml">
            <intent>
                <action android:name="android.support.customtabs.action.CustomTabsService" />
            </intent>
</custom-config-file>
  • do cordova prepare
  • check manifest file - ok
  • do cordova prepare again
  • check manifest file - not OK, manifest contain multiple sections queries

example

AndroidManifest
<queries>
        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
        <intent>
            <action android:name="android.intent.action.GET_CONTENT" />
        </intent>
        <intent>
            <action android:name="android.intent.action.PICK" />
        </intent>
        <intent>
            <action android:name="com.android.camera.action.CROP" />
            <data android:mimeType="image/*" android:scheme="content" />
        </intent>
    </queries>
    <queries>
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
        <intent>
            <action android:name="android.intent.action.GET_CONTENT" />
        </intent>
        <intent>
            <action android:name="android.intent.action.PICK" />
        </intent>
        <intent>
            <action android:name="com.android.camera.action.CROP" />
            <data android:mimeType="image/*" android:scheme="content" />
        </intent>
    </queries>


Expected behavior:
plugin should replace the value in the section

Environment information

  • Cordova CLI version
    • cordova -v - 10.0.0
  • Cordova platform version
    • cordova platform ls
  • Plugins & versions installed in project (including this plugin)
    • cordova plugin ls
  • Dev machine OS and version, e.g.
    • OSX
      • 12.0.1 (21A559)

Android build issue:

  • Node JS version
    • node -v - v14.18.1

Related code:

insert any relevant code here such as plugin API calls / input parameters

Console output

with `mode="add"` plugin duplicate original section and add the item into other section every time on `cordova prepare`
<queries>
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
        <intent>
            <action android:name="android.intent.action.GET_CONTENT" />
        </intent>
        <intent>
            <action android:name="android.intent.action.PICK" />
        </intent>
        <intent>
            <action android:name="com.android.camera.action.CROP" />
            <data android:mimeType="image/*" android:scheme="content" />
        </intent>
        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
    </queries>
    <queries>
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
        <intent>
            <action android:name="android.intent.action.GET_CONTENT" />
        </intent>
        <intent>
            <action android:name="android.intent.action.PICK" />
        </intent>
        <intent>
            <action android:name="com.android.camera.action.CROP" />
            <data android:mimeType="image/*" android:scheme="content" />
        </intent>
    </queries>


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant