Ionic App not running on ios/Android but working on browser - ionic-framework

I developed an app that was working perfectly on Ionic DevApp on my iPhone. Suddenly it stopped working. I even tested a new blank app and it does not work. I tested on many wifi and 3G signals and also on an Android phone but it does not work!
On my iPhone I’m getting the following error:
Unable to load page. The request timed out.
On the Android phone I got this error:
error err_connection_timed_out.
I tried running the following, but none worked:
ionic serve
ionic serve -c
ionic serve -c --no-proxy
Running ionic info gives me:
Ionic:
ionic (Ionic CLI) : 4.5.0 (C:\Users\rodri\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : android 7.1.2, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.3, (and 5 other plugins)
System:
NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
EDIT:
I tried running ionic repair which gives me this error:
shell.js: internal error
Error: ETIMEDOUT: connection timed out, read
[ERROR] An error occurred while running subprocess cordova.
cordova prepare exited with exit code 1.

It was just a Firewall coming from McAfee Firewall blocking the port I needed. Just had to open the port on the McAfee app.

Related

Problem with serving Ionic 3 app in browser

I have huge problems when serving app in browser.
Upon running it prompts with 'gap_init:3'
I know it means android code is deployed in browser , which is wrong.
First run on device is fine. But next time I run it in browser I got this annoying error
Here are my npm commands with Ionic info bellow
"serve": "ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build"
"run": "ionic cordova run android --device --enableLint false "
Ionic info:
Ionic CLI : 5.4.13 (C:\Users\xxx\AppData\Roaming\nvm\v10.15.3\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.3
#ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res (update available: 0.8.1) : 0.6.0
native-run (update available: 0.3.0) : 0.2.8
System:
Android SDK Tools : 26.1.1 (e:\Android\SDK)
NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10

I need to compile an old project (IONIC 2)

I have a project on ionic 2, which I have not touched for 3 years, but the client is asking me to change a simple link. And I can not build the application. What should I take into account to recover this project?
I do not want to migrate to ionic 3 or ionic 4, I just want to change the webservices link and that the application continues in ionic 2.
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
#ionic/app-scripts : 1.1.4
Cordova Platforms : none
Ionic Framework : ionic-angular 2.2.0
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.2
Node : v8.9.3
npm : 5.5.1
OS : macOS
Xcode : Xcode 10.1 Build version 10B61
Is it possible to build this old project on ionic 2 on my computer?
EDIT:
when sudo ionic cordova platform add android i get:
`(node:41668) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch platform cordova-android#7.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm WARN #ionic/app-scripts#1.1.4 requires a peer of #angular/tsc-wrapped#* but none is installed. You must install peer dependencies yourself.
npm WARN #ionic/cli-plugin-ionic-angular#1.3.1 requires a peer of #ionic/app-scripts#^1.3.7 but none is installed. You must install peer dependencies yourself.
npm ERR! Cannot read property '0' of undefined`
u should install Cordova first, like this,use # plus version number as needed
npm install -g cordova

Problems to emulate after Xcode update

After update my Xcode from 10.1 to 10.2, I have problem to emulate the app on ios emulators.
After I run $ ionic cordova emulate ios -l, I get this:
BUILD SUCCEEDED
[cordova]
[cordova] No target specified for emulator. Deploying to undefined simulator
[cordova] Device type "com.apple.CoreSimulator.SimDeviceType.undefined" could not be found.
[ERROR] An error occurred while running subprocess cordova.
$ ionic cordova emulate ios --list
Available ios virtual devices:
So I've did
$ cd platforms/ios/cordova/ && npm i ios-sim#latest
But, I keep getting No target specified for emulator. Deploying to undefined simulator, just like before.
I also tried instal the next version of ios-sim, but I think it's compatible.
$ ionic info
Ionic:
ionic (Ionic CLI) : 4.12.0 (/Users/jeansilva/.nvm/versions/node/v8.12.0/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.3
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : ios 4.5.5
Cordova Plugins : no whitelisted plugins (13 plugins total)
System:
Android SDK Tools : 26.1.1 (/Users/jeansilva/Library/Android/sdk/)
ios-deploy : 1.9.4
ios-sim : ios-sim/9.0.0-dev.1 darwin-x64 node-v8.12.0
NodeJS : v8.12.0 (/Users/jeansilva/.nvm/versions/node/v8.12.0/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.2 Build version 10E125
Faced similar problem, after hours of making app run on simulator following command works for me
ionic cordova emulate ios --livereload --consolelogs --target="iPhone-6,com.apple.CoreSimulator.SimRuntime.iOS-10-1"
or you can try this if above don't work
ionic cordova emulate ios --livereload --consolelogs --target="iPhone-6,com.apple.CoreSimulator.SimRuntime.iOS-10-1" --buildFlag="-UseModernBuildSystem=0"
Let me know if it doesn't solve your issue.

Ionic googleplus plugin: Refused to display in a frame because it set 'X-Frame-Options' to 'sameorigin'

I am facing this issue when running in browser mode. How can I solve this? Would be possible to open this dialog in a new tab instead of an iFrame?
https://github.com/EddyVerbruggen/cordova-plugin-googleplus
Many thanks for the help!
Using Ionic with following settings:
cordova-plugin-googleplus 5.3.2 "Google SignIn"
Ionic:
ionic (Ionic CLI) : 4.0.5 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0, browser 5.0.4, ios 4.5.5
System:
NodeJS : v8.11.3 (/usr/local/bin/node)
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 10.0 Build version 10A255
Try removing the cordova-plugin-inappbrowser plugin.
Coexist with inAppBrowser plugin (fixed)
Some plugins can only be tested/working inside a device.
I remember that the google+ sign need to use the google play services and the apk signature those things aren't available running in local browser with chrome.
It's likely you test the android push notifications with the chrome it won't work.
For these type of things better if you call the ionic with the live reload to test in the device and reload when you make changes
ionic cordova run android -l -c

Getting "Sorry! The configured backend (pro) does not know about ionic upload" When trying to upload the Ionic App

I'm trying to upload the App I built to my Ionic Pro account.
I've linked my account and added the SSH keys but after running ionic upload I'm getting this error
[ERROR] Sorry! The configured backend (pro) does not know about ionic upload.
This is My Ionic Info
cli packages: (/home/jos/Desktop/helloapp/node_modules)
#ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2
global packages:
Cordova CLI : 7.0.1
Gulp CLI : not installed globally
local packages:
Cordova Platforms : android 6.2.3 browser 4.1.0
Ionic Framework : ionic1 1.3.1
System:
Android SDK Tools : 26.0.2
Node : v6.11.0
npm : 3.10.10
OS : Linux 3.13
ionic upload doesn't work with backend pro, you have to create an app
on https://dashboard.ionicjs.com/apps and there will be a setup guide :)