3121041
@3121041

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

[アプリ名]が予期しない理由で終了しました。

Q&A

Closed

解決したいこと

現在SwiftでiOSアプリを作っています。
ビルドして起動し、一通り想定通り動かせている状態です。
しかし、Simulatorの方でアプリを終了させてもう一度アプリを開くと、クラッシュして、[アプリ名]が予期しない理由で終了しました。と出てきます。調べると、ビルドしてすぐにクラッシュする例はありましたが、2回目以降にアプリが開けなくなる例がありませんでした。
既に何が何だか分からなくなっており、どこを見せれば良いかも分かっておりません。
何が原因か教えていただけるとありがたいです。

Alamofire, SwiftSoupを使ったアプリです。

発生している問題・エラー

コンソールにエラーは表示されていません。
[アプリ名]が予期しない理由で終了しました。の「詳細情報を表示」を押したら出てきた文です。

"bus"がアプリ名です。

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 8E1552D7-ED4F-4894-8687-7A4BD772DED0
CrashReporter Key:   7C09C586-AB17-02FF-3DB3-3A789A2B98A6
Hardware Model:      iMac19,2
Process:             bus [3887]
Path:                /Users/*/Library/Developer/CoreSimulator/Devices/0F564AFB-180A-4542-9B4C-64044BF40DCC/data/Containers/Bundle/Application/384843CC-774A-4C60-983F-792B135A0E70/bus.app/bus
Identifier:          組織.bus
Version:             1.0 (1)
Code Type:           X86-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [2516]
Coalition:           com.apple.CoreSimulator.SimDevice.0F564AFB-180A-4542-9B4C-64044BF40DCC [1987]
Responsible Process: SimulatorTrampoline [1011]

Date/Time:           2024-09-30 17:29:53.0065 +0900
Launch Time:         2024-09-30 17:29:52.9658 +0900
OS Version:          macOS 14.6.1 (23G93)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/Alamofire.framework/Alamofire
Referenced from: <A0D1AA08-5BAC-30A5-AB66-CA3D37208815> /Users/*/Library/Developer/CoreSimulator/Devices/0F564AFB-180A-4542-9B4C-64044BF40DCC/data/Containers/Bundle/Application/384843CC-774A-4C60-983F-792B135A0E70/bus.app/bus
Reason: tried: '/Users/3121041/Library/Developer/CoreSimulator/Devices/0F564AFB-180A-4542-9B4C-64044BF40DCC/data/Containers/Bundle/Application/384843CC-774A-4C60-983F-792B135A0E70/bus.app/Frameworks/Alamofire.framework/Alamofire' (no such file), '/Users/3121041/Library/Developer/CoreSimulator/Devices/0F564AFB-180A-4542-9B4C-64044BF40DCC/data/Containers/Bundle/Application/384843CC-774A-4C60-983F-792B135A0E70/bus.app/Frameworks/Alamofire.framework/Alamofire' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Alamofire.framework/Alamofire' (no such file)
(terminated at launch; ignore backtrace)

Triggered by Thread:  0

Thread 0 Crashed:
0   dyld                          	       0x112c0d87a __abort_with_payload + 10
1   dyld                          	       0x112c267f7 abort_with_payload_wrapper_internal + 82
2   dyld                          	       0x112c26829 abort_with_payload + 9
3   dyld_sim                      	       0x1049520e5 abort_with_payload + 26
4   dyld_sim                      	       0x1049050d8 dyld4::halt(char const*, dyld4::StructuredError const*) + 335
5   dyld_sim                      	       0x1049034cc dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3492
6   dyld_sim                      	       0x10490234c _dyld_sim_prepare + 844
7   dyld                          	       0x112bb0e21 dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1558
8   dyld                          	       0x112baf5d1 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 279
9   dyld                          	       0x112baf2e4 start + 1812


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000002000209  rbx: 0x0000000000000001  rcx: 0x00007ff7bba702a8  rdx: 0x00007ff7bba70720
  rdi: 0x0000000000000006  rsi: 0x0000000000000001  rbp: 0x00007ff7bba702f0  rsp: 0x00007ff7bba702a8
   r8: 0x00007ff7bba70320   r9: 0x0000000000000000  r10: 0x00000000000000e9  r11: 0x0000000000000246
  r12: 0x0000000000000000  r13: 0x00007ff7bba70720  r14: 0x0000000000000006  r15: 0x00000000000000e9
  rip: 0x0000000112c0d87a  rfl: 0x0000000000000246  cr2: 0x0000000000000000
  
Logical CPU:     0
Error Code:      0x02000209 
Trap Number:     133


Binary Images:
       0x112ba9000 -        0x112c39fff dyld (*) <18f658dd-20f3-324d-b7ac-8a9c60b574b3> /usr/lib/dyld
       0x10448c000 -        0x1044a4fff 組織.bus (1.0) <a0d1aa08-5bac-30a5-ab66-ca3d37208815> /Users/*/Library/Developer/CoreSimulator/Devices/0F564AFB-180A-4542-9B4C-64044BF40DCC/data/Containers/Bundle/Application/384843CC-774A-4C60-983F-792B135A0E70/bus.app/bus
       0x104901000 -        0x10495bfff dyld_sim (*) <0a2ea2cc-8e7f-3953-a752-65d9ba23780f> /Volumes/VOLUME/*/dyld_sim
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

EOF

-----------
Full Report
-----------

{"app_name":"bus","timestamp":"2024-09-30 17:29:53.00 +0900","app_version":"1.0","slice_uuid":"a0d1aa08-5bac-30a5-ab66-ca3d37208815","build_version":"1","platform":7,"bundleID":"組織.bus","share_with_app_devs":0,"is_first_party":0,"bug_type":"309","os_version":"macOS 14.6.1 (23G93)","roots_installed":0,"name":"bus","incident_id":"8E1552D7-ED4F-4894-8687-7A4BD772DED0"}
{
  "uptime" : 3800,
  "procRole" : "Foreground",
  "version" : 2,
  "userID" : 509099540,
  "deployVersion" : 210,
  "modelCode" : "iMac19,2",
  "coalitionID" : 1987,
  "osVersion" : {
    "train" : "macOS 14.6.1",
    "build" : "23G93",
    "releaseType" : "User"
  },
  "captureTime" : "2024-09-30 17:29:53.0065 +0900",
  "codeSigningMonitor" : 0,
  "incident" : "8E1552D7-ED4F-4894-8687-7A4BD772DED0",
  "pid" : 3887,
  "cpuType" : "X86-64",
  "roots_installed" : 0,
  "bug_type" : "309",
  "procLaunch" : "2024-09-30 17:29:52.9658 +0900",
  "procStartAbsTime" : 3898054931884,
  "procExitAbsTime" : 3898095191282,
  "procName" : "bus",
  "procPath" : "\/Users\/*\/Library\/Developer\/CoreSimulator\/Devices\/0F564AFB-180A-4542-9B4C-64044BF40DCC\/data\/Containers\/Bundle\/Application\/384843CC-774A-4C60-983F-792B135A0E70\/bus.app\/bus",
  "bundleInfo" : {"CFBundleShortVersionString":"1.0","CFBundleVersion":"1","CFBundleIdentifier":"組織.bus"},
  "storeInfo" : {"deviceIdentifierForVendor":"7CFE5F60-5A97-5CBD-9AC0-3404FEF124CE","thirdParty":true},
  "parentProc" : "launchd_sim",
  "parentPid" : 2516,
  "coalitionName" : "com.apple.CoreSimulator.SimDevice.0F564AFB-180A-4542-9B4C-64044BF40DCC",
  "crashReporterKey" : "7C09C586-AB17-02FF-3DB3-3A789A2B98A6",
  "responsiblePid" : 1011,
  "responsibleProc" : "SimulatorTrampoline",
  "codeSigningID" : "組織.bus",
  "codeSigningTeamID" : "",
  "codeSigningFlags" : 570425861,
  "codeSigningValidationCategory" : 10,
  "codeSigningTrustLevel" : 4294967295,
  "sip" : "disabled",
  "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
  "termination" : {"code":1,"flags":518,"namespace":"DYLD","indicator":"Library missing","details":["(terminated at launch; ignore backtrace)"],"reasons":["Library not loaded: @rpath\/Alamofire.framework\/Alamofire","Referenced from: <A0D1AA08-5BAC-30A5-AB66-CA3D37208815> \/Users\/*\/Library\/Developer\/CoreSimulator\/Devices\/0F564AFB-180A-4542-9B4C-64044BF40DCC\/data\/Containers\/Bundle\/Application\/384843CC-774A-4C60-983F-792B135A0E70\/bus.app\/bus","Reason: tried: '\/Users\/3121041\/Library\/Developer\/CoreSimulator\/Devices\/0F564AFB-180A-4542-9B4C-64044BF40DCC\/data\/Containers\/Bundle\/Application\/384843CC-774A-4C60-983F-792B135A0E70\/bus.app\/Frameworks\/Alamofire.framework\/Alamofire' (no such file), '\/Users\/3121041\/Library\/Developer\/CoreSimulator\/Devices\/0F564AFB-180A-4542-9B4C-64044BF40DCC\/data\/Containers\/Bundle\/Application\/384843CC-774A-4C60-983F-792B135A0E70\/bus.app\/Frameworks\/Alamofire.framework\/Alamofire' (no such file), '\/Library\/Developer\/CoreSimulator\/Volumes\/iOS_21F79\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 17.5.simruntime\/Contents\/Resources\/RuntimeRoot\/System\/Library\/Frameworks\/Alamofire.framework\/Alamofire' (no such file)"]},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":791,"task_for_pid":19},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":75150,"threadState":{"r13":{"value":140701981935392},"rax":{"value":33554953},"rflags":{"value":582},"cpu":{"value":0},"r14":{"value":6},"rsi":{"value":1},"r8":{"value":140701981934368},"cr2":{"value":0},"rdx":{"value":140701981935392},"r10":{"value":233},"r9":{"value":0},"r15":{"value":233},"rbx":{"value":1},"trap":{"value":133},"err":{"value":33554953},"r11":{"value":582},"rip":{"value":4609595514,"matchesCrashFrame":1},"rbp":{"value":140701981934320},"rsp":{"value":140701981934248},"r12":{"value":0},"rcx":{"value":140701981934248},"flavor":"x86_THREAD_STATE","rdi":{"value":6}},"frames":[{"imageOffset":411770,"symbol":"__abort_with_payload","symbolLocation":10,"imageIndex":0},{"imageOffset":514039,"symbol":"abort_with_payload_wrapper_internal","symbolLocation":82,"imageIndex":0},{"imageOffset":514089,"symbol":"abort_with_payload","symbolLocation":9,"imageIndex":0},{"imageOffset":332005,"symbol":"abort_with_payload","symbolLocation":26,"imageIndex":2},{"imageOffset":16600,"symbol":"dyld4::halt(char const*, dyld4::StructuredError const*)","symbolLocation":335,"imageIndex":2},{"imageOffset":9420,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":3492,"imageIndex":2},{"imageOffset":4940,"symbol":"_dyld_sim_prepare","symbolLocation":844,"imageIndex":2},{"imageOffset":32289,"symbol":"dyld4::prepareSim(dyld4::RuntimeState&, char const*)","symbolLocation":1558,"imageIndex":0},{"imageOffset":26065,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":279,"imageIndex":0},{"imageOffset":25316,"symbol":"start","symbolLocation":1812,"imageIndex":0}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4609183744,
    "size" : 593920,
    "uuid" : "18f658dd-20f3-324d-b7ac-8a9c60b574b3",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4366843904,
    "CFBundleShortVersionString" : "1.0",
    "CFBundleIdentifier" : "組織.bus",
    "size" : 102400,
    "uuid" : "a0d1aa08-5bac-30a5-ab66-ca3d37208815",
    "path" : "\/Users\/*\/Library\/Developer\/CoreSimulator\/Devices\/0F564AFB-180A-4542-9B4C-64044BF40DCC\/data\/Containers\/Bundle\/Application\/384843CC-774A-4C60-983F-792B135A0E70\/bus.app\/bus",
    "name" : "bus",
    "CFBundleVersion" : "1"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4371517440,
    "size" : 372736,
    "uuid" : "0a2ea2cc-8e7f-3953-a752-65d9ba23780f",
    "path" : "\/Volumes\/VOLUME\/*\/dyld_sim",
    "name" : "dyld_sim"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 140703128616960,
  "size" : 21474836480,
  "uuid" : "a65b978a-87f7-399a-9d46-7bbc59cf9f16"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=238.0M resident=0K(0%) swapped_out_or_unallocated=238.0M(100%)\nWritable regions: Total=20.8M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=20.8M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nSTACK GUARD                       56.0M        1 \nStack                             8192K        1 \nVM_ALLOCATE                       8708K        5 \n__DATA                            1027K       25 \n__DATA_CONST                      2640K       23 \n__DATA_DIRTY                        12K        3 \n__LINKEDIT                       216.3M        5 \n__OBJC_RO                         72.6M        1 \n__OBJC_RW                         2515K        1 \n__TEXT                            21.7M       24 \ndyld private memory               28.9G       19 \nshared memory                        8K        2 \n===========                     =======  ======= \nTOTAL                             29.3G      110 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "logWritingSignature" : "c8a1f97336272b37838bdcf86a0eed7602feeaf1",
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "60186475825c62000ccf5450",
      "factorPackIds" : {

      },
      "deploymentId" : 240000074
    },
    {
      "rolloutId" : "645197bf528fbf3c3af54105",
      "factorPackIds" : {
        "SIRI_VALUE_INFERENCE_PERVASIVE_ENTITY_RESOLUTION" : "663e65b4a1526e1ca0e288a1"
      },
      "deploymentId" : 240000002
    }
  ],
  "experiments" : [

  ]
}
}

Model: iMac19,2, BootROM 2022.100.22.0.0, 6 processors, 6-Core Intel Core i5, 3 GHz, 16 GB, SMC 2.47f3
Graphics: Radeon Pro 560X, Radeon Pro 560X, PCIe, 4 GB
Display: iMac, 4096 x 2304 Retina, Main, MirrorOff, Online
Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2667 MHz, Micron, 8ATF1G64HZ-2G6E3
Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2667 MHz, Micron, 8ATF1G64HZ-2G6E3
AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x7BF), wl0: Jul 10 2023 12:30:19 version 9.30.503.0.32.5.92 FWID 01-88a8883
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Ethernet, Ethernet, en0
USB Device: USB31Bus
USB Device: FaceTime HD Camera (Built-in)
USB Device: USB Optical Mouse
USB Device: USB Keyboard
Thunderbolt Bus: iMac, Apple Inc., 47.5

自分で試したこと

調べてみましたが、同じような例が見当たりませんでした。

0

1Answer

Simulator が落ちちゃいますか?

Library not loaded: @rpath/Alamofire.framework/Alamofire
Referenced from: /Users/*/Library/Developer/CoreSimulator/Devices/0F564AFB-180A-4542-9B4C-64044BF40DCC/data/Containers/Bundle/Application/384843CC-774A-4C60-983F-792B135A0E70/bus.app/bus
Reason: tried: '/Users/3121041/Library/Developer/CoreSimulator/Devices/0F564AFB-180A-4542-9B4C-64044BF40DCC/data/Containers/Bundle/Application/384843CC-774A-4C60-983F-792B135A0E70/bus.app/Frameworks/Alamofire.framework/Alamofire' (no such file), '/Users/3121041/Library/Developer/CoreSimulator/Devices/0F564AFB-180A-4542-9B4C-64044BF40DCC/data/Containers/Bundle/Application/384843CC-774A-4C60-983F-792B135A0E70/bus.app/Frameworks/Alamofire.framework/Alamofire' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Alamofire.framework/Alamofire' (no such file)

↑これが原因だと思いますが、「[アプリ名]が予期しない理由で終了しました。」ダイアログは、 Simulator 上に表示されますか?
Mac 上に表示されますか?

0Like

Comments

  1. @3121041

    Questioner

    回答ありがとうございます。
    Simulator自体は落ちてはいません。ビルドしたアプリだけが起動しなくなります。

    ダイアログはMac上に表示されています。
    スクリーンショット 2024-10-01 0.32.59.png

  2. Simulator自体は落ちてはいません。ビルドしたアプリだけが起動しなくなります。
    ダイアログはMac上に表示されています。

    Simulator上のアイコンをクリックして起動したアプリのダイアログがMac側に出ること自体が普通じゃ無いですね。
    Xcodeコードから起動すると(何度起動しても)落ちないということでしょうか?

    Simulator上のアプリを一旦削除して、再度、Xcodeコードから起動てみても同じでしょうか。
    また、実機でアプリを起動するとどうなるでしょうか?

  3. @3121041

    Questioner

    仰る通り、Xcodeから起動(左上の▶️ボタン)すれば、SImulatorでは落ちません。
    実機で起動してみたところ、Xcodeから起動(左上の▶️ボタン)しても開けませんでした。

    コンソールにエラーが出ていました。SImulator上で起動した時には出てこなかったので、関係あるかは分かりませんが。。。

    Logging Error: Failed to initialize logging system. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables.

  4. ↓これを一度試してみてください

  5. @3121041

    Questioner

    試してみましたが、変わりませんでした。
    あと、勘違いしていましたが、Simulatorで起動してもこのエラー文は出ていました。
    また、このエラー文はアプリを起動した時ではなく、アプリを終了したときに出てきていました。

  6. IDEPreferLogStreaming=YESへ環境変数を追加する方法

    変わらずでした?

  7. @3121041

    Questioner

    IDEPreferLogStreaming=YESへ環境変数を追加する方法

    をやったところ、

    Logging Error: Failed to initialize logging system. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables.

    は消えましたが、相変わらず予期しない理由で終了します。

    背景が赤ではなく緑だったので今まで気づいていなかったのですが、

    Message from debugger: Terminated due to signal 9

    というのが出ていたのですが、何か関係はあるのでしょうか?

  8. ↓ 同件かも?

  9. @3121041

    Questioner

    遅くなり申し訳ありません。
    “Frameworks, Libraries, and Embedded Content” にAlamofireとSwiftSoupを入れたら落ちなくなりました。
    回答ありがとうございました。

  10. あまりお役に立てませんでしたが、解決してよかったです。
    当Q&Aをクローズしていただければ と思います。

Your answer might help someone💌