Skip to content
This repository was archived by the owner on May 4, 2022. It is now read-only.
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

Open

Description

@jgw96

From @vahidvdn on December 2, 2016 6:35

Ionic version:
1.3.1

I'm submitting a ...
bug report

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?
e6fbeece-b7ec-11e6-9487-fe4e3b0f8a5c

Ionic info:

Cordova CLI: 5.4.0
Gulp version:  CLI version 3.9.1
Gulp local:
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.0.0
Ionic App Lib Version: 2.0.0-beta.20
OS: Windows 7 SP1
Node Version: v4.5.0

Copied from original issue: ionic-team/ionic-framework#9455

Activity

  1. jgw96 commented on Jan 13, 2017

    @jgw96
    ContributorAuthor

    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.

  2. jgw96 commented on Jan 13, 2017

    @jgw96
    ContributorAuthor

    From @vahidvdn on December 2, 2016 8:34

    @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
    
  3. jgw96 commented on Jan 13, 2017

    @jgw96
    ContributorAuthor

    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?

  4. jgw96 commented on Jan 13, 2017

    @jgw96
    ContributorAuthor

    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 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.

    No one has any idea?

  5. vahidvdn commented on Jan 31, 2017

    @vahidvdn

    Still no solution? Anybody?

  6. cozzbie commented on Feb 10, 2017

    @cozzbie
  7. vahidvdn commented on Feb 12, 2017

    @vahidvdn

    @cozzbie I couldn't find mentioned code. How should I fix it?

  8. cozzbie commented on Feb 12, 2017

    @cozzbie

    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

  9. vahidvdn commented on Feb 12, 2017

    @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.

  10. cozzbie commented on Feb 12, 2017

    @cozzbie

    Check your permissions @vahidvdn and your <meta http-equiv="Content-Security-Policy">. Those are the usual culprits for the whitescreen issue

  11. vahidvdn commented on Feb 12, 2017

    @vahidvdn

    @cozzbie Ok, I'll test it. Thank you.

  12. vahidvdn commented on Feb 12, 2017

    @vahidvdn

    @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)

  13. cozzbie commented on Feb 12, 2017

    @cozzbie

    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

  14. vahidvdn commented on Feb 12, 2017

    @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 :(

  15. 12 remaining items

  16. vahidvdn commented on Aug 1, 2017

    @vahidvdn

    @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)

  17. vahidvdn commented on Aug 1, 2017

    @vahidvdn

    @geshub vs-repeat is really bad in ios! The performance is extremely high, but scrolling is really awful.

  18. nalkon commented on Aug 1, 2017

    @nalkon

    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.

  19. geshub commented on Aug 1, 2017

    @geshub

    @vahidvdn thanks for the input. Did you manage to get a smooth scroll on IOS with large ( infinite scroll ) lists with photos ?

  20. vahidvdn commented on Aug 1, 2017

    @vahidvdn

    @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.

  21. nalkon commented on Aug 7, 2017

    @nalkon

    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.

  22. divinzer commented on Aug 13, 2017

    @divinzer

    @nalkon Thank you for good information, may I how can use virtualScroll and grid on IONIC?

  23. varsha123 commented on Aug 22, 2017

    @varsha123

    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

  24. vahidvdn commented on Aug 22, 2017

    @vahidvdn

    @varsha123 Try NativeScript 😆

  25. varsha123 commented on Aug 22, 2017

    @varsha123

    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

  26. cozzbie commented on Aug 23, 2017

    @cozzbie

    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.

  27. MikeCIDFG commented on Aug 18, 2018

    @MikeCIDFG

    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

  28. kollisandy commented on Oct 2, 2018

    @kollisandy
  29. shanemac10 commented on Feb 28, 2019

    @shanemac10

    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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions