Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Simulator crashes while real device does not

I work on a project that includes several libraries integrated as pods by Cocoapods - it has been a while but I think this error came up first when I integrated Cocoapods and hasn't disappeared ever since (so I started to use a real device for testing my builds).

Like I mentioned, I have no problems building on any real device but I constantly face the following error when building on the iOS simulator. Xcode completes the build successfully and starts up the simulator which then crashes as soon as it tries to load the build.

dyld: Symbol not found: _ACAccountTypeIdentifierTwitter
  Referenced from: .../Library/Developer/CoreSimulator/Devices/28482AD6-B0F2-4FBF-B525-C1EA3F2E07FA/data/Containers/Bundle/Application/D9992D1D-FE14-4403-A9DC-E5C1BB787E9E/projectName.app/projectName
  Expected in: flat namespace
 in .../Library/Developer/CoreSimulator/Devices/28482AD6-B0F2-4FBF-B525-C1EA3F2E07FA/data/Containers/Bundle/Application/D9992D1D-FE14-4403-A9DC-E5C1BB787E9E/projectName.app/projectName
(lldb)

I got cautious with changing linking options because when I faced this problem first, it affected also the building of Xcode itself which then failed again and again because of some difficult-for-me-to-understand errors. Furthermore I don't make use of any Twitter specific code, it just seems to be part of an integrated library.

Any help is highly appreciate as I'd very much like to be able to build on the simulator again!

EDIT 1

Build Phases

Build Settings

EDIT 2

dyld`_dyld_start:
    0x7fff6431d000 <+0>:   popq   %rdi
    0x7fff6431d001 <+1>:   pushq  $0x0
    0x7fff6431d003 <+3>:   movq   %rsp, %rbp
    0x7fff6431d006 <+6>:   andq   $-0x10, %rsp
    0x7fff6431d00a <+10>:  subq   $0x10, %rsp
    0x7fff6431d00e <+14>:  movl   0x8(%rbp), %esi
    0x7fff6431d011 <+17>:  leaq   0x10(%rbp), %rdx
    0x7fff6431d015 <+21>:  movq   0x37aec(%rip), %r8        ;     _dyld_start_static
    0x7fff6431d01c <+28>:  leaq   -0x23(%rip), %rcx         ; <+0>
    0x7fff6431d023 <+35>:  subq   %r8, %rcx
    0x7fff6431d026 <+38>:  leaq   -0x102d(%rip), %r8
    0x7fff6431d02d <+45>:  leaq   -0x8(%rbp), %r9
    0x7fff6431d031 <+49>:  callq  0x7fff6431d076            ;     dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*)
->  0x7fff6431d036 <+54>:  movq   -0x8(%rbp), %rdi
    0x7fff6431d03a <+58>:  cmpq   $0x0, %rdi
    0x7fff6431d03e <+62>:  jne    0x7fff6431d050            ; <+80>
    0x7fff6431d040 <+64>:  movq   %rbp, %rsp
    0x7fff6431d043 <+67>:  addq   $0x8, %rsp
    0x7fff6431d047 <+71>:  movq   $0x0, %rbp
    0x7fff6431d04e <+78>:  jmpq   *%rax
    0x7fff6431d050 <+80>:  addq   $0x10, %rsp
    0x7fff6431d054 <+84>:  pushq  %rdi
    0x7fff6431d055 <+85>:  movq   0x8(%rbp), %rdi
    0x7fff6431d059 <+89>:  leaq   0x10(%rbp), %rsi
    0x7fff6431d05d <+93>:  leaq   0x8(%rsi,%rdi,8), %rdx
    0x7fff6431d062 <+98>:  movq   %rdx, %rcx
    0x7fff6431d065 <+101>: movq   (%rcx), %r8
    0x7fff6431d068 <+104>: addq   $0x8, %rcx
    0x7fff6431d06c <+108>: testq  %r8, %r8
    0x7fff6431d06f <+111>: jne    0x7fff6431d065            ; <+101>
    0x7fff6431d071 <+113>: jmpq   *%rax
    0x7fff6431d073 <+115>: nop
like image 222
Alexei S. Avatar asked Jul 30 '15 12:07

Alexei S.


People also ask

Why does my iOS game keep crashing?

Sometimes, apps crash because something goes wrong with them over time. This can happen even after you update the app to the latest version. If you've tried all the steps so far and it hasn't helped, try deleting the app and then reinstalling it. A fresh installation of the app could help.

How do you fix an app that keeps crashing iOS?

To fix iPhone apps that keep crashing: To do this, swipe up on your Home Screen or, if your iPhone has a Home button, double-press the Home button to bring up your most recent apps. Swipe up on the app to close it, and then reopen it. Restart the phone. Then open the app and see if it's working properly.

Is iOS simulator like the hardware?

An iOS Simulator basically mimics an iOS app or browser on top of a developer's operating system. This is viewable in an iPad or iPhone like window. They cannot virtualize the actual hardware conditions of an iOS device, which is the main requirement for comprehensive testing and debugging.

Do I need Xcode for iOS simulator?

Launching the Simulator, though, always requires opening Xcode and going to Developer Tools. Because the Simulator. app is embedded within the Xcode app bundle, apps like LaunchBar won't find it to index it. LaunchBar, which is my launcher of choice, also ignores aliases, so dragging Simulator.


1 Answers

Unfortunately, the iOS simulator does not fully support twitter accounts. Your phone does. The crash you're getting is for missing the _ACAccountTypeIdentifierTwitter. If you want to make sure that does not happen on the simulator, wherever you're checking for ACAccountType, check to make sure that ACAccountTypeIdentifierTwitter is available. Same for facebook, SinaWeibo, and TencentWeibo.

like image 197
Fennelouski Avatar answered Sep 24 '22 00:09

Fennelouski