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

<edit-config> changes in this plugin conflicts with <edit-config> changes in config.xml #9

Closed
t2wu opened this issue May 18, 2019 · 11 comments

Comments

@t2wu
Copy link

t2wu commented May 18, 2019

I have this conflict during installation:

Failed to install 'cordova-plugin-webpack': Error: cordova-plugin-webpack cannot be added. changes in this plugin conflicts with changes in config.xml. Conflicts must be resolved before plugin can be added.

My relevant items in config.xml looks like this:

        <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:allowBackup="false" />
            <application android:fullBackupContent="false" />
        </edit-config>

How do I solve it?

kotarella1110 added a commit that referenced this issue May 20, 2019
android:usesCleartextTraffic is true by default. removed because it is unnecessary.

#9
@kotarella1110
Copy link
Owner

kotarella1110 commented May 20, 2019

Removed edit-config element from plugin.xml file, as it is unnecessary.
android:usesCleartextTraffic attribute in application element is true by default.

https://developer.android.com/guide/topics/manifest/application-element

android:usesCleartextTraffic
Indicates whether the app intends to use cleartext network traffic, such as cleartext HTTP. The default value is "true".

I just published to npm the plugin v0.3.2.
Please install the latest plugin version.
Thank you.

@kotarella1110
Copy link
Owner

@t2wu Can I close this?

@kotarella1110
Copy link
Owner

kotarella1110 commented May 23, 2019

If the app targets Android 9 or higher, I know that the application element's android:usesCleartextTraffic attribute is false by default.

https://developer.android.com/about/versions/pie/android-9.0-changes-28#tls-enabled

Network TLS enabled by default

If your app targets Android 9 or higher, the isCleartextTrafficPermitted() method returns false by default. If your app needs to enable cleartext for specific domains, you must explicitly set cleartextTrafficPermitted to true for those domains in your app's Network Security Configuration.

net::ERR_CLEARTEXT_NOT_PERMITTED error popup is displayed on Android 9 or higher.
Because I reopen this.

@kotarella1110 kotarella1110 reopened this May 23, 2019
kotarella1110 added a commit that referenced this issue May 24, 2019
Added note of Android 9 and higher devices

#9
@kotarella1110
Copy link
Owner

kotarella1110 commented May 24, 2019

  • To resolve this plugin conflict, leave the edit-config element removed from the plugin.xml file.
  • If the app targets Android 9 or higher, this plugin users must modify the config.xml file to enable cleartext support.

@kotarella1110
Copy link
Owner

Hey @t2wu , if the app targets Android 9 or higher:

          <edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application">
              <application android:allowBackup="false" />
              <application android:fullBackupContent="false" />
+             <application android:usesCleartextTraffic="true" />
          </edit-config>

Thank you.

@DuaneQ
Copy link

DuaneQ commented Sep 3, 2020

I've been trying to resolve this to no avail. The plugin fails on install because it's trying to add the edit-config on install.
This is my config.xml

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:networkSecurityConfig="@xml/network_security_config" /> <application android:allowBackup="false" /> <application android:fullBackupContent="false" /> <application android:usesCleartextTraffic="true" /> </edit-config>

Here is the plugin .xml

`

<name>ImagePicker</name>

<description>
    This plugin allows selection of multiple images from the camera roll / gallery in a phonegap app
</description>

<license>MIT</license>

<engines>
    <engine name="cordova" version=">=3.5.0" />
</engines>

<js-module src="www/imagepicker.js" name="ImagePicker">
    <clobbers target="plugins.imagePicker" />
</js-module>

<!-- ios -->
<platform name="ios">
    <config-file target="config.xml" parent="/*">
        <feature name="ImagePicker">
            <param name="ios-package" value="SOSPicker"/>
        </feature>
    </config-file>

    <preference name="PHOTO_LIBRARY_USAGE_DESCRIPTION" default=" " />
    <config-file target="*-Info.plist" parent="NSPhotoLibraryUsageDescription">
      <string>$PHOTO_LIBRARY_USAGE_DESCRIPTION</string>
    </config-file>

    <header-file src="src/ios/SOSPicker.h" />
    <source-file src="src/ios/SOSPicker.m" />

    <header-file src="src/ios/GMImagePicker/UIImage+fixOrientation.h" />
    <source-file src="src/ios/GMImagePicker/UIImage+fixOrientation.m" />

    <header-file src="src/ios/GMImagePicker/GMAlbumsViewCell.h" />
    <source-file src="src/ios/GMImagePicker/GMAlbumsViewCell.m" />

    <header-file src="src/ios/GMImagePicker/GMAlbumsViewController.h" />
    <source-file src="src/ios/GMImagePicker/GMAlbumsViewController.m" />

    <header-file src="src/ios/GMImagePicker/GMFetchItem.h" />
    <source-file src="src/ios/GMImagePicker/GMFetchItem.m" />

    <header-file src="src/ios/GMImagePicker/GMGridViewCell.h" />
    <source-file src="src/ios/GMImagePicker/GMGridViewCell.m" />

    <header-file src="src/ios/GMImagePicker/GMGridViewController.h" />
    <source-file src="src/ios/GMImagePicker/GMGridViewController.m" />

    <header-file src="src/ios/GMImagePicker/GMImagePickerController.h" />
    <source-file src="src/ios/GMImagePicker/GMImagePickerController.m" />

    <header-file src="src/ios/GMImagePicker/PSYBlockTimer.h" />
    <source-file src="src/ios/GMImagePicker/PSYBlockTimer.m" />

    <header-file src="src/ios/GMImagePicker/GMPHAsset.h" />
    <source-file src="src/ios/GMImagePicker/GMPHAsset.m" />

    <resource-file src="src/ios/GMImagePicker/GMEmptyFolder@1x.png" />
    <resource-file src="src/ios/GMImagePicker/GMEmptyFolder@2x.png" />

    <resource-file src="src/ios/GMImagePicker/GMSelected.png" />
    <resource-file src="src/ios/GMImagePicker/GMSelected@2x.png" />

    <resource-file src="src/ios/GMImagePicker/GMVideoIcon.png" />
    <resource-file src="src/ios/GMImagePicker/GMVideoIcon@2x.png" />

    <resource-file src="src/ios/GMImagePicker/ca.lproj" />
    <resource-file src="src/ios/GMImagePicker/de.lproj" />
    <resource-file src="src/ios/GMImagePicker/en.lproj" />
    <resource-file src="src/ios/GMImagePicker/es.lproj" />
    <resource-file src="src/ios/GMImagePicker/fr.lproj" />
    <resource-file src="src/ios/GMImagePicker/it.lproj" />
    <resource-file src="src/ios/GMImagePicker/pt.lproj" />
    <resource-file src="src/ios/GMImagePicker/pl.lproj" />
    <resource-file src="src/ios/GMImagePicker/zh-Hans.lproj" />

    <framework src="Accelerate.framework" />
    <framework src="Security.framework" />
    <framework src="Photos.framework" />
    <framework src="SystemConfiguration.framework" />
    <framework src="QuartzCore.framework" />

</platform>

<!-- android -->
<platform name="android">
    <config-file target="res/xml/config.xml" parent="/*">
        <feature name="ImagePicker">
            <param name="android-package" value="com.synconset.ImagePicker"/>
        </feature>
    </config-file>

    <config-file target="AndroidManifest.xml" parent="/manifest/application">
        <activity android:label="@string/multi_app_name" android:name="com.synconset.MultiImageChooserActivity" android:theme="@style/Theme.AppCompat.Light">
        </activity>
    </config-file>

    <config-file target="AndroidManifest.xml" parent="/manifest">
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    </config-file>

    <framework src="com.android.support:appcompat-v7:23+" />

    <source-file src="src/android/com/synconset/ImagePicker/ImagePicker.java" target-dir="src/com/synconset" />
    <source-file src="src/android/com/synconset/ImagePicker/FakeR.java" target-dir="src/com/synconset" />

    <source-file src="src/android/Library/src/ImageFetcher.java" target-dir="src/com/synconset"/>
    <source-file src="src/android/Library/src/MultiImageChooserActivity.java" target-dir="src/com/synconset"/>

    <resource-file src="src/android/Library/res/anim/image_pop_in.xml" target="res/anim/image_pop_in.xml"/>
    <resource-file src="src/android/Library/res/drawable/grid_background.xml" target="res/drawable/grid_background.xml"/>
    <resource-file src="src/android/Library/res/drawable-hdpi/image_bg.9.png" target="res/drawable-hdpi/image_bg.9.png"/>
    <resource-file src="src/android/Library/res/drawable-hdpi/loading_icon.png" target="res/drawable-hdpi/loading_icon.png"/>
    <resource-file src="src/android/Library/res/drawable-mdpi/ic_action_discard_dark.png" target="res/drawable-mdpi/ic_action_discard_dark.png"/>
    <resource-file src="src/android/Library/res/drawable-mdpi/ic_action_discard_light.png" target="res/drawable-mdpi/ic_action_discard_light.png"/>
    <resource-file src="src/android/Library/res/drawable-mdpi/ic_action_done_dark.png" target="res/drawable-mdpi/ic_action_done_dark.png"/>
    <resource-file src="src/android/Library/res/drawable-mdpi/ic_action_done_light.png" target="res/drawable-mdpi/ic_action_done_light.png"/>
    <resource-file src="src/android/Library/res/drawable-mdpi/ic_launcher.png" target="res/drawable-mdpi/ic_launcher.png"/>
    <resource-file src="src/android/Library/res/drawable-xhdpi/ic_action_discard_dark.png" target="res/drawable-xhdpi/ic_action_discard_dark.png"/>
    <resource-file src="src/android/Library/res/drawable-xhdpi/ic_action_discard_light.png" target="res/drawable-xhdpi/ic_action_discard_light.png"/>
    <resource-file src="src/android/Library/res/drawable-xhdpi/ic_action_done_dark.png" target="res/drawable-xhdpi/ic_action_done_dark.png"/>
    <resource-file src="src/android/Library/res/drawable-xhdpi/ic_action_done_light.png" target="res/drawable-xhdpi/ic_action_done_light.png"/>
    <resource-file src="src/android/Library/res/drawable-xhdpi/ic_launcher.png" target="res/drawable-xhdpi/ic_launcher.png"/>
    <resource-file src="src/android/Library/res/layout/actionbar_custom_view_done_discard.xml" target="res/layout/actionbar_custom_view_done_discard.xml"/>
    <resource-file src="src/android/Library/res/layout/actionbar_discard_button.xml" target="res/layout/actionbar_discard_button.xml"/>
    <resource-file src="src/android/Library/res/layout/actionbar_done_button.xml" target="res/layout/actionbar_done_button.xml"/>
    <resource-file src="src/android/Library/res/layout/multiselectorgrid.xml" target="res/layout/multiselectorgrid.xml"/>
    <resource-file src="src/android/Library/res/values/multiimagechooser_strings_en.xml" target="res/values/multiimagechooser_strings_en.xml"/>
    <resource-file src="src/android/Library/res/values/themes.xml" target="res/values/themes.xml"/>

    <resource-file src="src/android/Library/res/values-de/multiimagechooser_strings_de.xml" target="res/values-de/multiimagechooser_strings_de.xml"/>
    <resource-file src="src/android/Library/res/values-es/multiimagechooser_strings_es.xml" target="res/values-es/multiimagechooser_strings_es.xml"/>
    <resource-file src="src/android/Library/res/values-fr/multiimagechooser_strings_fr.xml" target="res/values-fr/multiimagechooser_strings_fr.xml"/>
    <resource-file src="src/android/Library/res/values-hu/multiimagechooser_strings_hu.xml" target="res/values-hu/multiimagechooser_strings_hu.xml"/>
    <resource-file src="src/android/Library/res/values-ja/multiimagechooser_strings_ja.xml" target="res/values-ja/multiimagechooser_strings_ja.xml"/>
    <resource-file src="src/android/Library/res/values-ko/multiimagechooser_strings_ko.xml" target="res/values-ko/multiimagechooser_strings_ko.xml"/>
    <source-file src="src/android/Library/res/values-pl/multiimagechooser_strings_pl.xml" target-dir="res/values-pl"/>

    <framework src="src/android/ignorelinterrors.gradle" custom="true" type="gradleReference"/>
    <framework src="src/android/androidtarget.gradle" custom="true" type="gradleReference"/>
</platform>
`

@sufiyansiraj
Copy link

@DuaneQ were you able to resolve this issue ?

@DuaneQ
Copy link

DuaneQ commented Sep 5, 2020

@DuaneQ were you able to resolve this issue ?

Yes, by removing the android platform, installing telerik, manually removing the edit-config element then reinstalling android

@sufiyansiraj
Copy link

@DuaneQ were you able to resolve this issue ?

Yes, by removing the android platform, installing telerik, manually removing the edit-config element then reinstalling android

thank you for the response, but when i removed the edit config it gives an error for application tag not bound.
do you know anything about is ?
Thank you once again.

@DuaneQ
Copy link

DuaneQ commented Sep 8, 2020

@DuaneQ were you able to resolve this issue ?

Yes, by removing the android platform, installing telerik, manually removing the edit-config element then reinstalling android

thank you for the response, but when i removed the edit config it gives an error for application tag not bound.
do you know anything about is ?
Thank you once again.

It sounds like you may have removed the opening but not closing tag or removed a following opening tag mistakenly.

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

No branches or pull requests

4 participants