fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 989 forks source link

Unable to add icon in PGB 7+ #459

Open Firzenizer opened 6 years ago

Firzenizer commented 6 years ago

Using older Phongap versions 6.x.x works just fine, but when upgrading to 7+, I am having trouble adding the notification icon.

Previously I had added the icon with this: <resource-file src="www/res/files/fcm_push_icon.png" target="res/drawable/fcm_push_icon.png" />

In the newer PGB versions I am getting following error: Updating resource files at ..

  copy  www/res/files/google-services.json ../app/google-services.json (new file)
  copy  www/res/files/fcm_push_icon.png ../res/drawable/fcm_push_icon.png (new file)
Prepared android project successfully
--------------------------------------------------------------------------------
PLUGIN OUTPUT
--------------------------------------------------------------------------------
"plugman-151 install --platform android --project  --plugin cordova-plugin-app-version@0.1.9 --nohooks=.": Fetching plugin "cordova-plugin-app-version@0.1.9" via npm
Installing "cordova-plugin-app-version" at "0.1.9" for android
Failed to install 'cordova-plugin-app-version': Error: ENOENT: no such file or directory, open '/AndroidManifest.xml'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at Object.parseElementtreeSync (/cordova/node_modules/cordova-common/src/util/xml-helpers.js:180:27)
    at new AndroidManifest (/cordova/lib/AndroidManifest.js:29:20)
    at AndroidProject.getPackageName (/cordova/lib/AndroidProject.js:99:12)
    at Api.addPlugin (/cordova/Api.js:223:57)
    at handleInstall (/.npm/lib/node_modules/pgb-plugman-151/node_modules/pgb-cordova-lib/src/plugman/install.js:594:10)
    at /.npm/lib/node_modules/pgb-plugman-151/node_modules/pgb-cordova-lib/src/plugman/install.js:364:24
    at _fulfilled (/.npm/lib/node_modules/pgb-plugman-151/node_modules/q/q.js:787:54)
ENOENT: no such file or directory, open '/AndroidManifest.xml'

This error goes away if I remove the resource-file. Here is more about cordova android 7.0: https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

Firzenizer commented 6 years ago

Oh I think this is the fix that is needed! https://github.com/fechanique/cordova-plugin-fcm/pull/439