Results 1 to 7 of 7

Thread: error "Thread 9: EXC_BAD_ACCESS (code=1, address..." on app load to device with XCode

  1. #1

    Default error "Thread 9: EXC_BAD_ACCESS (code=1, address..." on app load to device with XCode

    Hello, I have developed an app using Sencha Touch and Phonegap. When testing the app on iphone device using XCode, I get error Thread 9: EXC_BAD_ACCESS (code=1, address...
    From what i can see, the error happens when starting the app after installs. I am not getting error on the simulator.
    I have Googled it, but did not see any relevant post which makes me believe that it is something i am doing wrong.
    In addition to getting the above error during initial load with XCode, I am also experiencing the phone locking up (screen not responding) when starting the app again by tapping on the icon (after it has been closed).
    I know it is a memory issue but i do not know how to go about solving it.
    -Sencha Touch 2.4.1
    -Sencha Cmd 5.1.2
    -Phonegap 4.2.0-0.24.2
    -Cordova 4.2.0
    -XCode 6.2
    -IOS 8.2
    The only plugin i have is the cordova camera plugin

    Any help will be greatly appreciated, thank you

  2. #2
    Sencha User
    Join Date
    Feb 2013


    You may have seen this, but here's a stack overflow thread with quite a bit of information.

    It definitely seems to be memory related. Do you have the same problem if you compile a simple test app?

  3. #3

    Default easier to read

    Thank you Gary for the reply,
    I just created a new ST2 app and got the same error.
    the process i follow is this:
    - cd to the touch-2.4.1 folder and created "sencha generate app newtest ../newTest"
    - cd to the newTest folder and run "sencha phonegap init com.newtest.newtest"
    - in app.json un-commented the line for '"platform": "ios"'
    - run "sencha app build native"
    then opened XCode from newtest.xcodeproj in newTest/phonegap/platforms/ios
    then run on iphone device.
    First, the files are installed on the device and the icon is created (all good so far)
    then the app starts and i see the loading icon ....
    then i get the error and a white background.
    I get the error BEFORE seeing the sencha app blue backgroung and 3 flashing dots.

    Some notes: i have been developping my original app over a couple of months and did periodic test on the iPhone device at various phases of the app development AND never got this error.
    So could it be because i upgraded versions a couple of times and there is a conflict with one of the updates ?
    OR do I really have a memory issue even if the app is just trying to load and not even running yet.
    BTW thank you for the link, beside the fact that it is a blog related to Obj C not Sencha, and the fact that I know nothing about Obj C , I still did learn that this error seems to be due to memory allocated to variable that you try to access again after it has been used and destroyed OR could be a memory leak OR you try to access a variable that has not being initialized (for which i would also get errors with the development tools from Google when testing the app on Chrome or even running on the simulator).
    I am just at a loss for answers, thank you again.
    Last edited by patrickd241; 27 Mar 2015 at 6:42 PM. Reason: readability

  4. #4

    Default Same Problem here

    Hi patrickd241,

    I'm experiencing the same problem. Random crashes "exc_bad_access" in webthread with
    - Sencha Touch 2.4.1 - Sencha CMD
    - Cordova CLI 4.1. - Cordova 3.7
    - xCode 6.2
    - iOS 8.2 on device only, iOS Simulator is fine

    Have you made any progress with this problem?

    It is very similar to this:

    And I noticed that the error occurs with native build only:
    $ sencha app build native
    The production build seems to be fine. Does this apply to your project?

    Does anyone know what exactly is the difference between the production and native build (besides cordova build)?

    Thanks in advance

  5. #5
    Sencha Premium Member u25771's Avatar
    Join Date
    Sep 2012
    Switzerland :)


    Are there any news to this topic? Suffering from this issue very badly... The problem only occurs with older projects which are upgraded to the newest version.

    - Sencha Touch 2.4.2 - Sencha Architect 3.2.0 Build 193 - Sencha CMD
    - Cordova CLI 5.1.1. - Cordova 3.8
    - xCode 6.4
    - iOS 8.4 on device
    Mark thread as answered if your problem could be solved and leave a vote for helpful answers

    For more help check out my new blog:

    o get in contact with me just send me a message on Google+

  6. #6
    Sencha Premium Member
    Join Date
    Jan 2012
    London, UK


    I'm also seeing this. Let me know if you guys have any update. One of the things I'm looking at is if it happens on the iOS9 beta. If not an acceptable approach would be to adapt the wkwebview cordova plugin to only run on iOS8; at the moment it runs on iOS >= 8. That way 6, 7, would run uiwebview (where this bug didn't exist), 8 would run wkwebview (which works fine, although does have implications elsewhere which can be worked around) and 9 would go back to uiwebview.u25771 - are you saying this bug doesn't exist in an older version of touch? or an older version of cordova?
    ExtJS Websql/Sqlite/IndexedDB/Dynamic proxies:

  7. #7
    Sencha Premium Member
    Join Date
    Jan 2012
    London, UK


    Some more info for you guys.

    TL;DR: use the wkwebview plugin here:

    This'll have some other implications you'll have to workaround. CORS will need to be enabled on your AJAX servers, for instance. But trust me, this is worth doing.

    Another thing. I have found sencha app build native to be funky using the WKWebView. I have found doing sencha app build testing and then moving the app.js file into cordova before the cordova build, does a better job. Again, don't ask me why. I only have time to find solutions, not to explain them! Just throw:

    Into .sencha/app/ so the app.js file is still minified.

    I'd love to know the difference between the app.js file produced by sencha app build native and sencha app build testing with the above setting. Again, no time! But I was finding that I was getting a javascript error related to Ext.Container otherwise. Seemed to be when adding two things of the same xtype to a single container.

    Anyway, back to this issue.

    The reason I was apprehensive to suggest wkwebview as the workaround earlier was that up to iOS9 beta 3 there was a showstopper bug affecting the wkwebview. In my app, it related to switching tabs in a tabbar.

    In iOS9 beta 4 this bug seems to have gone. It may come back, who knows but for now it's ok. It's iOS beta testing for you; this time last year WhatsApp was bust on iOS8 beta.

    I believe the bug as its reported here only affects older devices. FWIW using the (cordova default) uiwebview, I was unable to replicate the bug on iOS9 beta 4 via installing using code-beta.

    So for now use Xcode 6.4 and the wkwebview. I know this works; I have two apps live in the app store problem free using this setup, each getting hundreds of installs a day.

    At some point we'll need to switch over to what is now the xcode-beta. At the moment that won't compile the cordova-plugin-webserver that the wkwebview plugin needs. But we have until January for the plugin developers to work around that issue; technically the web server plugin isn't even needed on iOS9 anyway since the app can now be loaded over the file:// protocol since Apple fixed that bug too.
    ExtJS Websql/Sqlite/IndexedDB/Dynamic proxies:

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts