You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 4, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on May 4, 2022. It is now read-only.
ionic app suddenly crashes and closes itself in ios #59
Current behavior:
Recently I confronted with a problem in my ionic app. This only appears in ios 9 (I didn't test in other versions of ios). Why I said recently? Since a few days a go, I didn't have a lot of data in my remote database. No when I load some data with ion-infinite-scroll , and change some states, suddenly app closes with NO ERRORS.
Other information:
I use gapDebug for watching the console log. But no errors appears. Any idea?
@faraazc I'm not able to update it. I run this command: ionic lib update or even ionic lib , I get this error:
This command has been deprecate. All resources are currently available in NPM and we recommend that you use NPM to manage these.
More information is available here: https://github.com/driftyco/ionic-cli/wiki/Migrating-to-NPM-from-bower
Local Ionic version: 1.3.1 (C:\Users\Cebit\myApp06\www\lib\ionic\bower.json)
Invalid version: undefined
After spending a lot of time, I couldn't be able to solve this issue.
But I found out, When I go to the child tab in ionic tab component, this occurs, or when there is a lot of xmlHttpRequest that happens in ion-infinite-scroll. It seems there is memory or cpu issues as discussed in some places like here or here.
NOTE: I even updated my cordova cli and cordova-ios , but no difference.
The problem you are definitely facing is from a poor design of the UIView used in old iOS. It causes uncontrollable memory leaks. Head over to http://blog.ionic.io/cordova-ios-performance-improvements-drop-in-speed-with-wkwebview/ for a more efficient view with WKWebView. Although it seems to be still experimental, I can guarantee that its very much improved with no leaks @vahidvdn
@cozzbie Thanks. I have already tried WKWebView , but I couldn't be able to run it. It showed me blank white page. But I should try it again. Maybe I missed something.
@cozzbie I found out something interesting. By this code:
if (window.indexedDB) {
alert("I'm in WKWebView!");
} else {
alert("I'm in UIWebView");
}
I could be able to find out my iphone is using which type of webview. In an iphone 4s (ios 9.3) it alerts UIWebView , but in an iphone 6 it alerts WKWebView.
In UIWebView it crashes very fast (after some page transition and request) , but in WKWebView it's better (but still occurs)
WKWebView was introduced in iOS 9 so I really wonder why your iPhone 9.3 is using the UIWebView. Well, there you have it. Try to not create very large lists and you'd be fine. @vahidvdn
@cozzbie My list is too short. Just loading 3 items and fetching more data by ion-infinite-scroll. This issue seems to relates to ion-tabs transition. In single state works fine, but when I go to other tabs and states, it occurs :(
@nalkon So, your using ionic2/Angular2 as you mentioned to ngFor. There are a lot of improvement in Angular2. But the story is still the same. You keep all elements in DOM, then it leads to memory leak.
In ionic2 collection-repeat is virtualScroll. Maybe this help you. (Please let me know about the result of virtualScroll)
I tried to use VirtualScroll some time ago and had a lot of problems with it, basically didn't manage to get it work. But there were a lot of changes since then. So, I'm going to give it another try. I'll let you know.
@geshub No I couldn't. After a few weeks working on both collection-repeat and vs-repeat I decided to use simple ng-repeat. That's really disappointing.
Just wanted to let you guys know that it seems like I solved my main problem. I'm still not sure what caused it. Probably number of things that didn't work well together. To solve it I completely re-wrote html with scroll and list. I took as an example the html from Ionic Conference app and tweaked it to my purposes. It uses virtualScroll and grid. My app doesn't crash any more and even performance is decent. However I'm having other problems now, but they have to do with the app functionality and the way the app worked with the "old" html. I probably will need to re-write parts of the code. But over all it's a good news. Took me week and a half to get there.
I am facing same also facing memory leak issue on ios only and because of this app is getting crashed after some time. App is build using ionic2 and cordova 7.0.1.
To resolve this I have added WKWebView plugin in ionic2 application.
I am getting device ready fired but native plugin not working as I have below code in app.components.ts
StatusBar.styleDefault();
Splashscreen.hide();
I am not getting console or alert after these 2 lines. That was getting with UIWebview.
I have already added native plugins of statusbar and splashscreen those are working with old UIWebview.
Now i am facing issue with WKWebView with this webview plugins not working.
Can we use all ionic or codova native plugin with WKWebView? Why do we need to nativescript? Please give more details on this as this is my first ionic app so not getting me usevof native script here.
NativeScript is not the same as native plugins. NativeScript is a framework much like Ionic. What @vahidvdn is basically telling you to do is port your entire app from Ionic to NativeScript. @varsha123
As far as your issue goes, try reinstalling the ios platform by deleting and re-downloading it so that your plugins are refreshed. But first, remove and reinstall your plugins and try upgrading to Ionic 3.
Ran into this issue today nearly a year after the last posts.
Filtering a long list of (~400) items caused the app to crash only on an older iPad running iOS 10.3. No issues on Android, and although slow on an iPhone 5S (also running 10.3) it didn't crash.
Installing the latest WKWebView plugin solved the problem.
The list filters fine now, the virtualScroll is more responsive, and crashes are gone! ionic cordova plugin add cordova-plugin-ionic-webview
For weeks now I've been chasing an issue with my iOS app crashing on multiple devises around the same time, and at what seemed like random timeframes. Come to find out when you run your app from Xcode on a devise, Apple gives your default provisioning profile about a week or less to run, then the app won't open any longer when that time runs out. Then you have to re-run it from Xcode. I thought it was a bug, or a memory leak or something, but no, it was just the default settings on my Apple developer account. I had no idea.
If you are chasing this issue, you might first make sure your Apple certificates and provisioning profiles are in order.
Activity
jgw96 commentedon Jan 13, 2017
From @faraazc on December 2, 2016 7:2
@vahidvdn please update ionic libs to latest RC.3. I faced similar issue. upgrading to latest did fix.
jgw96 commentedon Jan 13, 2017
From @vahidvdn on December 2, 2016 8:34
@faraazc I'm not able to update it. I run this command:
ionic lib updateor evenionic lib, I get this error:jgw96 commentedon Jan 13, 2017
From @vahidvdn on December 7, 2016 13:37
Recently I found out this issue also occurs in ios 10 in a iphone 6 mobile. (Actually this happens hardly ever on ios 10)
Any solution?
jgw96 commentedon Jan 13, 2017
From @vahidvdn on December 15, 2016 8:26
After spending a lot of time, I couldn't be able to solve this issue.
But I found out, When I go to the child
tabin ionic tab component, this occurs, or when there is a lot of xmlHttpRequest that happens inion-infinite-scroll. It seems there is memory or cpu issues as discussed in some places like here or here.NOTE: I even updated my cordova cli and cordova-ios , but no difference.
No one has any idea?
vahidvdn commentedon Jan 31, 2017
Still no solution? Anybody?
cozzbie commentedon Feb 10, 2017
Head over to ionic-team/ionic-framework#1096 (reference) @vahidvdn
vahidvdn commentedon Feb 12, 2017
@cozzbie I couldn't find mentioned code. How should I fix it?
cozzbie commentedon Feb 12, 2017
The problem you are definitely facing is from a poor design of the UIView used in old iOS. It causes uncontrollable memory leaks. Head over to http://blog.ionic.io/cordova-ios-performance-improvements-drop-in-speed-with-wkwebview/ for a more efficient view with WKWebView. Although it seems to be still experimental, I can guarantee that its very much improved with no leaks @vahidvdn
vahidvdn commentedon Feb 12, 2017
@cozzbie Thanks. I have already tried
WKWebView, but I couldn't be able to run it. It showed me blank white page. But I should try it again. Maybe I missed something.cozzbie commentedon Feb 12, 2017
Check your permissions @vahidvdn and your
<meta http-equiv="Content-Security-Policy">. Those are the usual culprits for the whitescreen issuevahidvdn commentedon Feb 12, 2017
@cozzbie Ok, I'll test it. Thank you.
vahidvdn commentedon Feb 12, 2017
@cozzbie I found out something interesting. By this code:
I could be able to find out my iphone is using which type of webview. In an iphone 4s (ios 9.3) it alerts
UIWebView, but in an iphone 6 it alertsWKWebView.In
UIWebViewit crashes very fast (after some page transition and request) , but inWKWebViewit's better (but still occurs)cozzbie commentedon Feb 12, 2017
WKWebView was introduced in iOS 9 so I really wonder why your iPhone 9.3 is using the UIWebView. Well, there you have it. Try to not create very large lists and you'd be fine. @vahidvdn
vahidvdn commentedon Feb 12, 2017
@cozzbie My list is too short. Just loading 3 items and fetching more data by
ion-infinite-scroll. This issue seems to relates to ion-tabs transition. In single state works fine, but when I go to other tabs and states, it occurs :(12 remaining items
vahidvdn commentedon Aug 1, 2017
@nalkon So, your using ionic2/Angular2 as you mentioned to
ngFor. There are a lot of improvement in Angular2. But the story is still the same. You keep all elements inDOM, then it leads to memory leak.In ionic2 collection-repeat is
virtualScroll. Maybe this help you. (Please let me know about the result of virtualScroll)vahidvdn commentedon Aug 1, 2017
@geshub
vs-repeatis really bad in ios! The performance is extremely high, but scrolling is really awful.nalkon commentedon Aug 1, 2017
I tried to use VirtualScroll some time ago and had a lot of problems with it, basically didn't manage to get it work. But there were a lot of changes since then. So, I'm going to give it another try. I'll let you know.
geshub commentedon Aug 1, 2017
@vahidvdn thanks for the input. Did you manage to get a smooth scroll on IOS with large ( infinite scroll ) lists with photos ?
vahidvdn commentedon Aug 1, 2017
@geshub No I couldn't. After a few weeks working on both collection-repeat and vs-repeat I decided to use simple ng-repeat. That's really disappointing.
nalkon commentedon Aug 7, 2017
Just wanted to let you guys know that it seems like I solved my main problem. I'm still not sure what caused it. Probably number of things that didn't work well together. To solve it I completely re-wrote html with scroll and list. I took as an example the html from Ionic Conference app and tweaked it to my purposes. It uses virtualScroll and grid. My app doesn't crash any more and even performance is decent. However I'm having other problems now, but they have to do with the app functionality and the way the app worked with the "old" html. I probably will need to re-write parts of the code. But over all it's a good news. Took me week and a half to get there.
divinzer commentedon Aug 13, 2017
@nalkon Thank you for good information, may I how can use virtualScroll and grid on IONIC?
varsha123 commentedon Aug 22, 2017
Hello
I am facing same also facing memory leak issue on ios only and because of this app is getting crashed after some time. App is build using ionic2 and cordova 7.0.1.
To resolve this I have added WKWebView plugin in ionic2 application.
I am getting device ready fired but native plugin not working as I have below code in app.components.ts
StatusBar.styleDefault();
Splashscreen.hide();
I am not getting console or alert after these 2 lines. That was getting with UIWebview.
Please let me know what is wrong in this case.
Thanks
Varsha
vahidvdn commentedon Aug 22, 2017
@varsha123 Try NativeScript 😆
varsha123 commentedon Aug 22, 2017
I have already added native plugins of statusbar and splashscreen those are working with old UIWebview.
Now i am facing issue with WKWebView with this webview plugins not working.
Can we use all ionic or codova native plugin with WKWebView? Why do we need to nativescript? Please give more details on this as this is my first ionic app so not getting me usevof native script here.
Thanks
Varsha
cozzbie commentedon Aug 23, 2017
NativeScript is not the same as native plugins. NativeScript is a framework much like Ionic. What @vahidvdn is basically telling you to do is port your entire app from Ionic to NativeScript. @varsha123
As far as your issue goes, try reinstalling the ios platform by deleting and re-downloading it so that your plugins are refreshed. But first, remove and reinstall your plugins and try upgrading to Ionic 3.
MikeCIDFG commentedon Aug 18, 2018
Ran into this issue today nearly a year after the last posts.
Filtering a long list of (~400) items caused the app to crash only on an older iPad running iOS 10.3. No issues on Android, and although slow on an iPhone 5S (also running 10.3) it didn't crash.
Installing the latest WKWebView plugin solved the problem.
The list filters fine now, the virtualScroll is more responsive, and crashes are gone!
ionic cordova plugin add cordova-plugin-ionic-webviewkollisandy commentedon Oct 2, 2018
chek below link
https://ionichow.com/question/camera-not-working-suddenly-in-ios/
shanemac10 commentedon Feb 28, 2019
For weeks now I've been chasing an issue with my iOS app crashing on multiple devises around the same time, and at what seemed like random timeframes. Come to find out when you run your app from Xcode on a devise, Apple gives your default provisioning profile about a week or less to run, then the app won't open any longer when that time runs out. Then you have to re-run it from Xcode. I thought it was a bug, or a memory leak or something, but no, it was just the default settings on my Apple developer account. I had no idea.
If you are chasing this issue, you might first make sure your Apple certificates and provisioning profiles are in order.
Checkout my answer on StackOverflow for more info...