react-native-iap icon indicating copy to clipboard operation
react-native-iap copied to clipboard

It crashes when I launch the app on iPHone6 iOS 12, but it doesn't crash on iOS 13

Open zyestin opened this issue 4 months ago • 1 comments

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

After the ipa package is generated in archive. It crashed every time I opened the app, on iPhone 6 / iOS 12. However, there's no problem in debug.

It is possible that the minimum iOS version supported by swift is 13

Expected Behavior

App launched normally

Screenshots

https://github.com/dooboolab-community/react-native-iap/assets/51897571/ba8b6f5e-5c26-408b-873f-a889d5ae277e

Environment:

  • react-native-iap: 12.13.0
  • react-native: 0.61.5
  • Platforms (iOS, Android, emulator, simulator, device): iOS 12

To Reproduce

Once the iap library is integrated into any project and archived to generate ipa. Every time open the app on an iPhone 6 or iOS 12 machine, it crashes.


[Optional] Additional Context

Xcode run with Release, then get it's crash log

* thread #1, stop reason = signal SIGABRT
  * frame #0: 0x000000010564e418 dyld`__abort_with_payload + 8
    frame #1: 0x000000010564da58 dyld`abort_with_payload_wrapper_internal + 100
    frame #2: 0x000000010564da88 dyld`abort_with_payload + 12
    frame #3: 0x00000001056108f8 dyld`dyld::halt(char const*) + 304
    frame #4: 0x00000001056136e4 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 5396
    frame #5: 0x000000010560d044 dyld`_dyld_start + 68

zyestin avatar Mar 08 '24 10:03 zyestin

Solution I found the solution here 👉🏻 dyld: Library not loaded: /System/Library/Frameworks/SwiftUI.framework/SwiftUI

Do as below image

Key info Why I found solution by search dyld: Library not loaded: /System/Library/Frameworks/SwiftUI.framework/SwiftUI ?
Because I suspected it was caused by the storekit2 api, I deleted the storekit2 api code in RNIapIosSk2.swift. Then I run the app using Xcode with release config. It crashed with more infomation as below.

error: '...' is not a valid command.
dyld: Library not loaded: /System/Library/Frameworks/SwiftUI.framework/SwiftUI
  Referenced from: /var/containers/Bundle/Application/B09E8A00-DF05-4E67-A775-1C6B732BFD54/HuabenApp.app/HuabenApp
  Reason: image not found
(lldb) bt
* thread #1, stop reason = signal SIGABRT
  * frame #0: 0x0000000104e7a418 dyld`__abort_with_payload + 8
    frame #1: 0x0000000104e79a58 dyld`abort_with_payload_wrapper_internal + 100
    frame #2: 0x0000000104e79a88 dyld`abort_with_payload + 12
    frame #3: 0x0000000104e3c8f8 dyld`dyld::halt(char const*) + 304
    frame #4: 0x0000000104e3f6e4 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 5396
    frame #5: 0x0000000104e39044 dyld`_dyld_start + 68

So it is clearly about swiftUI.

zyestin avatar Mar 11 '24 08:03 zyestin