0

Trying to do a simple PhoneGap build with MCCordovaPlugin. Keep getting this error:

java.lang.RuntimeException: Unable to get provider com.salesforce.marketingcloud.cordova.MCInitProvider: java.lang.IllegalStateException: Missing required properties: notificationCustomizationOptions

<preference name="**com.salesforce.marketingcloud.app_id**" value="xxx" />
<preference name="**com.salesforce.marketingcloud.access_token**" value="xxx" />
<preference name="**com.salesforce.marketingcloud.tenant_specific_endpoint**" value="https://xxx.device.marketingcloudapis.com/" />

<plugin name="cordova-plugin-camera" source="npm" version="2.4.1"/>
<plugin name="cordova-plugin-geolocation" source="npm" version="4.0.1"/>
<plugin name="cordova-plugin-network-information" source="npm" version="2.0.1" />
<plugin name="cordova-plugin-splashscreen" source="npm" version="5.0.2" />
<plugin name="cordova-plugin-whitelist" source="npm" version="1.3.3" />
<plugin name="ionic-plugin-keyboard" source="npm" version="2.2.1" />
<plugin name="cordova-plugin-inappbrowser" source="npm" version="3.0.0" />

<plugin name="**cordova-plugin-marketingcloudsdk**" spec="**6.2.1**" />

<platform name="android">
    <allow-intent href="market:*" />
    <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
    <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
    <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
    <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
    <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
    <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
    <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
    <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
    <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
    <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
    <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
    <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
    <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
    <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
    <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
    <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
    <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
    <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />

    <!-- required by Firebase FCM Marketing Cloud: cordova-plugin-fcm-with-dependecy-updated -->
    <resource-file src="google-services.json" target="app/google-services.json" />

    <!-- required by Salesforce Marketing Cloud: cordova-plugin-marketingcloudsdk -->
    <preference name="**com.salesforce.marketingcloud.notification_small_icon**" value="**ic_notification**" />

</platform>

Where is ic_notification.png supposed to be in the project hierarchy?

1 Answer 1

3

You need to map the image in your config.xml such that it (all density versions) will end up in the correct the Android app res folder.

For example: If I store my notification icons (ic_notification.png) in density dependent folders (/res/android/drawable-{DENSITY}/ic_notification.png) then I would need to map those images like this:

<platform name="android">
  <resource-file src="google-services.json" target="app/google-services.json" />
  <resource-file src="res/android/drawable-mdpi/ic_notification.png" target="app/src/main/res/drawable-mdpi/ic_notification.png" />
  <resource-file src="res/android/drawable-hdpi/ic_notification.png" target="app/src/main/res/drawable-hdpi/ic_notification.png" />
  <resource-file src="res/android/drawable-xhdpi/ic_notification.png" target="app/src/main/res/drawable-xhdpi/ic_notification.png" />
  <resource-file src="res/android/drawable-xxhdpi/ic_notification.png" target="app/src/main/res/drawable-xxhdpi/ic_notification.png" />

  <preference name="com.salesforce.marketingcloud.notification_small_icon" value="ic_notification" />
</platform>

2
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Adrian Larson
    Aug 14, 2019 at 13:43
  • adding this line got me over the exception; <resource-file src="res/android/drawable/ic_notification.png" target="app/src/main/res/drawable/ic_notification.png" />
    – RJS
    Aug 14, 2019 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.