ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 656 forks source link

Getting Caught exception: undefined on cordova plugin #1878

Closed philipbrack closed 6 years ago

philipbrack commented 7 years ago

getting Caught exception "undefined" with "ionic state reset"

Expected behavior was to rebuild the platforms with plugins

Steps to reproduce:

  1. ionic start someProject --v2
  2. Update your plugins to match this list-

"cordovaPlugins": [ "cordova-plugin-device", "cordova-plugin-console", "cordova-plugin-geolocation", "cordova-plugin-whitelist", "cordova-plugin-splashscreen", "cordova-plugin-statusbar", "cordova-plugin-nativeaudio", "cordova-plugin-network-information", "ionic-plugin-keyboard", "com-sarriaroman-photoviewer", "cordova-plugin-ios-non-exempt-encryption" ],

  1. ionic state reset

Post the output of ionic info below please /Users/pbrack/dev/ionic2/i2_final:ionic info

Your system information:

Cordova CLI: 6.5.0 Ionic Framework Version: 2.0.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.0.0 ios-deploy version: 1.9.0 ios-sim version: 5.0.8 OS: macOS Sierra Node Version: v7.1.0 Xcode version: Xcode 8.2.1 Build version 8C1002

/Users/pbrack/dev/ionic2/i2_final:

philipbrack commented 7 years ago

Seems like the issue is related to one of the plugin dependencies of ionic native.

>ionic plugin add cordova-plugin-nativeaudio
Fetching plugin "cordova-plugin-nativeaudio" via npm

Error: Invalid character in entity name
Line: 8
Column: 54
Char:
ghost commented 7 years ago

Yes I am getting the exact same thing with nativeaudio.

dhaval85 commented 7 years ago

What's the solution for this?

philipbrack commented 7 years ago

My solution was to refactor my code to use cordova-plugin-media. Total time was about 20 minutes.

dhaval85 commented 7 years ago

Alright. Thanks man. I fixed the original plugin and sent a pull request. :)

ahadcove commented 7 years ago

So is this the only way. Don't really understand what you mean by refactoring the code. This is the same problem im having, but can't find a fix

Fetching plugin "cordova-plugin-nativeaudio" via npm

Error: Invalid character in entity name Line: 8 Column: 54 Char:

dhaval85 commented 7 years ago

@AhadCove I have fixed the module in below branch. You can use it until they integrate it in main line.

https://github.com/dhaval85/cordova-plugin-nativeaudio

ahadcove commented 7 years ago

Would I have to manually download and install it or could I modify this cli somewhere to point to yours?

ionic plugin add cordova-plugin-nativeaudio
dhaval85 commented 7 years ago

Instead of module name provide URL which I gave you.

keep1982 commented 7 years ago

ionic plugin add https://github.com/dhaval85/cordova-plugin-nativeaudio works like a charm. Thanks a lot for the fix @dhaval85

dhaval85 commented 7 years ago

@keep1982 : No problem. The fix has been merged to main project. You can switch back to main plugin project now.

dhaval85 commented 7 years ago

@philipbrack : Please close this issue now. It's been fixed in main project.

jfitzner commented 7 years ago

Your sure? i still have the same error. https://github.com/dhaval85/cordova-plugin-nativeaudio is working for me

dhaval85 commented 7 years ago

@WiNNiep00h : I am sure. They have merged into main line. Once they will make a release. It will work in main module as well. The dhaval85 fork is not going to be maintained. So make sure you switch to original repo.