I can not install local Notification and Cordova Toast plugin


#1

Hi , I have 2 problems, I can not install local Notification and Cordovatoast plugin, I get the following error for both:

Running command - failed!

ERROR] Cordova encountered an error.You may get more insight by running the Cordova command above directly.

ERROR] An error occurred while running cordova plugin add https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git-… (exit code 1):
Error: Failed to fetch plugin https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Aurora\AppData\Roaming\npm-cache_logs\2017-07-06T08_22_04_912Z-debug.log

As for the local notification plugin give the error described above, but I do not understand why in the plugin folder there is, and I also find it in the dependencies of the package.json file, but not in the plugin object.

Toast plugins give only the error.

I also noticed that after these failed setup attempts, my app can only be seen with the emulator, on my device I get the same error when I install the Local Notification and Toast plugins.

Today is the 3rd day I’m stuck, how can we fix it?


#2

Post your ionic info output please.


#3

Hello,
these are my ionic info:
global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1
Gulp CLI         : CLI version 3.9.1 Local version 3.9.1
Ionic CLI        : 3.4.0

local packages:

@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-gulp    : 1.0.1
@ionic/cli-plugin-ionic1  : 2.0.0
Cordova Platforms         : android 6.2.3
Ionic Framework           : ionic1 1.3.3

System:

Node       : v8.1.0
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

I’m studying a master as a full stack web developer, and in my course forum I was advised to delete the package.locks.json file and then install the plugins.

Doing so, only the Toast Plugin installation has been successful, local notification makes this error:

cordova plugin add de.appplant.cordova.plugin.local-notification --save
:heavy_multiplication_x: Running command - failed!

[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova plugin add de.appplant.cordova.plugin.local-notification --save (exit
code 1):

    Installing "de.appplant.cordova.plugin.local-notification" for android
    Plugin dependency "cordova-plugin-device@1.1.4" already fetched, using that version.
    Dependent plugin "cordova-plugin-device" already installed on android.
    Failed to install 'de.appplant.cordova.plugin.local-notification': Error
    at C:\Users\Aurora\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:205:33
    at _rejected
    (C:\Users\Aurora\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:864:24)
    at
    C:\Users\Aurora\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:890:30
    at Promise.when
    (C:\Users\Aurora\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch
    (C:\Users\Aurora\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:808:41)
    at
    C:\Users\Aurora\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:624:44
    at runSingle
    (C:\Users\Aurora\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:137:13)
    at flush
    (C:\Users\Aurora\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:95:7)
    at process._tickCallback (internal/process/next_tick.js:161:9)
    Error: Failed to fetch plugin cordova-plugin-app-event via registry.
    Probably this is either a connection problem, or plugin spec is incorrect.
    Check your connection and plugin name/version/URL.
    Failed to get absolute path to installed module

#4

Remove the platform and re-add it again.


#5

Do I have to remove cordova platform android and then try installing plugins again?

Is the command to remove ionic cordova platform remove android?


#6

Yes, sorry I didn’t explain it further:
ionic cordova platform remove android to remove the Android platform, ionic cordova platform add android to add it again. The plugins should be installed when the platform is added if they were installed correctly before. Run ionic cordova plugin list to check.


#7

Thanks for the reply, now I try.


#8

I did the following:
1- ionic cordova platform remove android
2-ionic cordova platform add android
3- ionic cordoova plugin add de.appplant.cordova.plugin.local-notification
Here I received the following error:

Cordova plugin add de.appplant.cordova.plugin.local-notification --save
:heavy_multiplication_x: Running command - failed!

[ERROR] Cordova encountered an error.
You can get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running the plugin cable add de.appplant.cordova.plugin.local-notification --save (exit
Code 1):

    Installing "de.appplant.cordova.plugin.local-notification" for android
    Plugin dependency "cordova-plugin-device@1.1.4" already fetched, using that version.
    Dependent plug-in "cordova-plugin-device" already installed on android.
    Failed to install 'de.appplant.cordova.plugin.local-notification': Error
    At C: \ Users \ Aurora \ AppData \ Roaming \ npm \ node_modules \ routing \ node_modules \ cordova-lib \ src \ plugman \ fetch.js: 205: 33
    At _rejected
    (C: \ Users \ Aurora \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova-fetch \ node_modules \ q \ q.js: 864: 24)
    at
    C: \ Users \ Aurora \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova-fetch \ node_modules \ q \ q.js: 890: 30
    At Promise.when
    (C: \ Users \ Aurora \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova-fetch \ node_modules \ q \ q.js: 1142: 31)
    At Promise.promise.promiseDispatch
    (C: \ Users \ Aurora \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova-fetch \ node_modules \ q \ q.js: 808: 41)
    at
    C: \ Users \ Aurora \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova-fetch \ node_modules \ q \ q.js: 624: 44
    At runSingle
    (C: \ Users \ Aurora \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova-fetch \ node_modules \ q \ q.js: 137: 13)
    At flush
    (C: \ Users \ Aurora \ AppData \ Roaming \ npm \ node_modules \ cordova \ node_modules \ cordova-fetch \ node_modules \ q \ q.js: 125: 13)
    At _combinedTickCallback (internal / process / next_tick.js: 95: 7)
    At process._tickCallback (internal / process / next_tick.js: 161: 9)
    Error: Failed to fetch cable-plugin-app-event plugin via registry.
    Probably this is either a connection problem, or plugin spec is incorrect.
    Check your connection and plugin name / version / URL.
    Failed to get absolute path to installed module

4- ionic cordova plugin list to check (despite the error i find it installed):
Cordova-plugin-camera 2.4.1 "Camera"
Cordova-plugin-compat 1.1.0 "Compat"
Cordova-plugin-console 1.0.5 "Console"
Cordova-plugin-device 1.1.4 "Device"
Cordova-plugin-image-picker 1.1.1 "ImagePicker"
Cordova-plugin-splashscreen 4.0.3 "Splashscreen"
Cordova-plugin-statusbar 2.2.1 "StatusBar"
Cordova-plugin-vibration 2.1.5 "Vibration"
Cordova-plugin-whitelist 1.3.1 "Whitelist"
De.appplant.cordova.plugin.local-notification 0.8.5 "LocalNotification"
Ionic-plugin-keyboard 2.2.1 “Keyboard”

5- ionic cordova plugin add cordova-plugin-x-toast Installed successfully.

Now I try to see if the app’s notification works. Because cordova local notification it says error and then it is installed?

Update:
I tried to launch the app but the notification does not come out, in the console I have this error:
TypeError: Can not read property ‘local’ of undefined
At Object.schedule (file: ///android_asset/www/lib/ngCordova/dist/ng-cordova.js: 5042: 45)
At file: ///android_asset/www/js/controllers.js: 300: 43
At file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 56238: 19
At Object.ionic.Platform.ready (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 2140: 9)
At Object.self.ready (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 56231: 26)
At Scope. $ Scope.addFavorite (file: ///android_asset/www/js/controllers.js: 298: 30)
At fn (eval at (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 27643: 15), : 4: 224)
At file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 65429: 9
At Scope. $ Eval (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 30400: 28)
At file.exe (file: ///android_asset/www/lib/ionic/js/ionic.bundle.js: 30500: 25)