How do I add Android to Cordova - cordova-plugins

I've managed to follow all the steps in the block materials up to installing Cordova but hit some problems when trying to add android. The error says that Cordova failed to fetch cordova-android#^9.1.0. Attached is the screen grab showing the list of errors:
Screenshot of Android installation error in Cordova
I have tried uninstalling and reinstalling all components including Cordova right from the very first step multiple times but I still cannot get it to work. I have also already checked that I am not going through a proxy server.
I tried adding android to Cordova using the command:
cordova platform add android
It should have added the Android platform for development in Cordova.

Related

No osx files in cordova-plugin-statusbar/networkstatus/network-information

I cloned the copay project for my development (https://github.com/Bitcoin-com/Wallet). There are dependencies involving statusbar and networkstatus, none for which the .m & .h files have been provided for OSX platform, in the cordova-plugin-statusbar and cordova-plugin-networkstatus (or the new cordova-plugin-network-information).
There are provisions only for android, iOS, windows, browser & wp. No OSX. The new cordova-plugin-network-information also includes (Blackberry10, firefoxos, tizen & ubuntu). Still no osx.
How can I work around this to be able to deploy to the osx platform?
THE UNDERLYING PROBLEM - For better understanding
After building copay and running the following command: $ cordova emulate osx, it builds OK and launches the OSX simulator with a blank screen. The other platforms (iOS and android) build and run OK, displaying the copay wallet app.
When i open the osx/Copay.xcodeproj file in Xcode, I run the app and it produces the same blank simulator screen. The error in the log reads:
2017-10-12 01:46:25.149 Copay[18616:649515] ERROR: Plugin 'NetworkStatus' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2017-10-12 01:46:25.149 Copay[18616:649515] ERROR: Plugin 'StatusBar' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2017-10-12 01:46:30.027 Copay[18616:649515] deviceready has not fired after 5 seconds.
2017-10-12 01:46:30.027 Copay[18616:649515] Channel not fired: onCordovaConnectionReady
Apparently, the plugins not loading is preventing the cordova "onCordovaConnectionReady" event from firing. So, what is the way around this?
If i am wrong, please point me in the right direction.
See attached images.
Thanks

Cordova platform add IOS Cocoapods and phonegap-push-plugin error in CMD

I'm working on a Cordova app in Visual Studio 2015.
I tried to add the iOS platform to cordova by running this in cmd
C:\cordovaProjectDirectory > cordova platform add iOS
this is the error I get
cocoapods error.jpg
I have been trying to get push notifications to work on my iOS device via remote build and I suspect this might be causing the problem.
Android device is working fine
What I have tried :
removing and installing phonegap-push-plugin
removing and installing ios platform
deleting platform/ios folder and clearing cordova cache
create empty project and run same cmds
Some info :
cordova cli 6.3.1
phonegap-push-plugin 1.9.2
node 5.6.0
npm 3.6.0
Alot of the solutions I see for installing Cocoapods are for MAC Terminal.
I have no idea what I'm missing or doing wrong.
Any advice is greatly appreciated!

Ionic ios access to it's plugins

I have made an app for ios and installed in my iphone. It has Camera plugin in it. It works perfect in android.
Also in iphone, as I run ionic view app (downloaded from appstore) it works perfect into that (first my phone asks about allowing access to camera), But not working in my own app.
NOTE: I installed .ipa from diawi.com
In ionic view app :
But in my own app, Nothing! Doesn't work. Even auto rotation just works in ionic view app.
Any idea?
Finally I found the solution:
Just add --save after installing a plugin. For example:
cordova plugin add cordova-plugin-camera --save
As in ionic package docs says:
Cordova plugins may be installed locally, they may not be defined explicitly in your config.xml. To ensure that the build servers know about which plugins you need, use the --save flag when adding and removing plugins.
Also pay attention to this.

Loading spinner not removed after Cordova update

My Ionic app was working absolutely fine until I got a message to upgrade Cordova from 6.0.0 to 6.1.0 after running cordova prepare to compile in xcode.
I then received a message to update to cordova-ios#4.0.0 or higher, which I also did.
This is when the trouble started. My app lost resources and I had to start updating plugins too. Did some searching and removed the platform and re-added.
Latest problem, which I can't seem to google is there is now a spinner that won't go away, and won't let me interact with the app. See screenshot below. I've remove all reference to $ionicLoading, even though the loader does not look like this.
Please, any help on where I can start debugging this would be greatly appreciated!
Mysterious loader that won't remove
Ended up being a problem with Ionic Keyboard. Steps to get it fixed for me was to:
cordova platform rm ios
cordova platform add ios
cordova plugin rm ionic-plugin-keyboard
cordova plugin add ionic-plugin-keyboard
Removed this code from js:
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
Then ran cordova prepare

Cordova Overriding Ionic - Application Gets Stuck at "Apache Cordova - Device Ready" Screen

I was having some issues lately with my Node / NPM / Ionic installations, so removed everything and installed again.
Since then, I notice a weird behavior after I start new projects through Ionic CLI (v1.7.7) - by running ionic start myApp blank, for instance (I've already tried removing ios platform and adding again before building the project).
Whenever I add the iOS platform, I noticed that the index.html file is not copied to the platforms/ios/www folder
When I run the app on iPhone it gets stuck at the "Apache Cordova - Device Ready" screen (probably as a result from the previous);
Splash screen shows Cordova logo, instead of Ionic one which used to be shown with my previous installation;
Application icon also shows Cordova logo - used to show Ionic logo
Cordova version is 5.3.3.
I'm running OS X Yosemite and my Node.JS version is 5.0.0.
I just had the same problem. I am on Mac OSX El Cap. I did everything you did, plus adding in homebrew (much easier on CLI see http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/)
I was stuck till I tried this stackoverflow question:(Cordova run --debug building blank app) where I found that I was having the same problem - ionic build is not copying the www folder over to the /platforms/ios/www folder. Once I copied this over it worked in the ios emulator.
I hope that helps till they fix it! What a pain! I like the platform - but not this error.
Someone from the Ionic Forum suggested downgrading Node to 4.2.2. It worked! :)

Resources