Telerik-Verified-Plugins / ImagePicker

Cordova Plugin For Multiple Image Selection
MIT License
182 stars 331 forks source link

Overwrite Themes.xml of Android 12 During platform adding #257

Open RethySen995 opened 2 years ago

RethySen995 commented 2 years ago

Android it's required with themes.xml as below: <?xml version='1.0' encoding='utf-8'?>

but during platform adding it's over write: <?xml version='1.0' encoding='utf-8'?>

Cordova-android it's throws the errors Cannot read properties of null (reading 'find') TypeError: Cannot read properties of null (reading 'find') node_modules\cordova-android\lib\prepare.js:387:49 at Array.forEach ().

so, How can we fix it? i hope you share it. thank you

geraldapeoples commented 1 year ago

The issue is the plugin.xml line -

<resource-file src="src/android/Library/res/values/themes.xml" target="res/values/themes.xml"/>

This replaces the themes.xml with the plugin one, if the plugin is removed then the themes.xml file is removed ...

If you change this to -

<!-- <resource-file src="src/android/Library/res/values/themes.xml" target="res/values/themes.xml"/> -->
<config-file target="res/values/themes.xml" parent="/resources">
    <style name="MyTheme" parent="android:Theme.Holo.Light">
    </style>
</config-file>

then the style is merged into the themes.xml

ArosPrince commented 1 year ago

The issue is the config.xml line -

Don't you mean plugin.xml ?

geraldapeoples commented 1 year ago

Yes you are absolutely right, the plugin.xml ... thank you for pointing that out.

clarklight commented 1 year ago

I removed that line but it doesn't open the gallery and is giving an error Error: Unable to find explicit activity class {com.app.app_dev/com.synconset.MultiImageChooserActivity}; have you declared this activity in your AndroidManifest.xml?

Then the gallery doesn't open...