Problems to emulate after Xcode update - ionic-framework

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.

Related

Changes are not getting reflected in Ionic 3 app even after successful build

I met a problem for 3 days with my application ionic 3.
In fact, after builder in prod and release mode, it is always the old version that is always taken into account. the changes do not reflect.
So when mode debug, the changes are well taken.
I tried several solutions may nothing.
Ionic v3
Also i have tried many solutions but no changes
ionic cordova platforms rm android
ionic cordova platforms add android
ionic cordova build android --prod --release --aot
------------no change-------------
I have downgrade the app-scripts version always same
i have delete the www folder and run ionic serve --lab after i run build commande still no change
I need help.
Thanks you in advance
Ionic:
Ionic CLI : 5.2.3
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.1.8
Cordova:
Cordova CLI : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic 3.1.2, cordova-plugin-ionic-webview 1.2.1, (and 18 other plugins)
Utility:
cordova-res : 0.6.0
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1 (C:\Sdk)
NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Build pass successfully
remove android platform using
ionic cordova platform rm android remove manually node-modules and
package-lock.json (imp*)
Unistall old Application
npm cache clean --force
finally run npm install
ionic cordova platform add android
ionic cordova build android
As #MD Khali said to remove the platform and add platform again, but if it happens after that you just need to click save 3-4 time. Because I have the same problem in my ionic 3 projects.
Finally I found the solution.
The problem was related to the ionic plugin (appflow).
I had two choices
1. Generate the apk from the appflow platform with the configured branch.
Remove the ionic plugin applflow
I took the choice 1.
Documentation of appflow https://ionicframework.com/appflow

Ionic live-reload executes twice on save

Every time I make a change to my code, live-reload executes twice. The first reload is quick (< 1 second), then there is a pause, then another reload fires and takes substantially longer (2 - 3 seconds).
When I create a fresh Ionic starter app, I don't get this problem. I have tried different IDEs and get the same result.
My ionic info:
Ionic:
ionic (Ionic CLI) : 4.12.0
Ionic Framework : ionic-angular 3.9.5
#ionic/app-scripts : 3.2.2
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)
System:
Android SDK Tools : 26.1.1 (/Users/alexandrsteinberg/Library/Android/sdk)
ios-deploy : 2.0.0
NodeJS : v8.12.0 (/Users/alexandrsteinberg/.nvm/versions/node/v8.12.0/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.2.1 Build version 10E1001

Ionic App not running on ios/Android but working on browser

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.

Ionic3 error on build ios Promise rejected with non-error: 'Error code 65

I am trying to create an ipa file but I have this unreadable error
when I run this command line on my Mac
ionic cordova build ios --prod --release
CordovaError: Promise rejected with non-error: 'Error code 65 for
command: xcodebuild with args:
-exportArchive,-archivePath,MyApp.xcarchive,-exportOptionsPlist,/Users/FSE/myApp04/platforms/ios/exportOptions.plist,-exportPath,/Users/FSE/myApp04/platforms/ios/build/device'
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
Ionic:
ionic (Ionic CLI) : 4.3.0 (/usr/local/lib/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 : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 4 other plugins)
System:
ios-deploy : 1.9.4
NodeJS : v11.0.0 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS
Xcode : Xcode 10.1 Build version 10B61
I've solved it like this
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
The accepted answer is correct. You can also put in build.json file:
{
"ios": {
"release": {
...,
"buildFlag": [
"-UseModernBuildSystem=0"
]
}
}
}
either
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
or just open
xcode -> File -> Workspace Settings
and change build system to "Legacy Build System"
In my experience the "buildFlag" is not enough, I mean I had:
"ionic cordova run ios -- --buildFlag=\"-UseModernBuildSystem=0\""
... but I was still getting the Error code 65.
To solve the issue you must open the project you find inside "yourproject/platforms/ios" in xcode and check that the signing certificate is ok. To do so just click on the project (first icon on the top-left panel) and check the "Signing" section.
For newer version of xcode, you have to have Legacy Build System. If you already have the Legacy Build System, then uncheck the automatic signing and recheck it. Don't know why but it worked for me.

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