d-date / google-mlkit-swiftpm

Google MLKit for iOS in Swift Package Manager
Apache License 2.0
92 stars 21 forks source link

MLKit has crashed with missing MLKITx_CCTClearcutUploader #16

Closed d-date closed 1 year ago

d-date commented 1 year ago

Due to lack of internal selector MLKITx_CCTClearcutUploader, the app has crash with runtime error as below.

2022-10-09 14:01:16.963 Example[55121/0x16daff000] [lvl=3] +[MLKITx_CCTClearcutUploader crashIfNecessary] Multiple instances of CCTClearcutUploader were instantiated. Multiple uploaders function correctly but have an adverse affect on battery performance due to lock contention.
2022-10-09 14:01:16.965219+0900 Example[55121:11997752] +[MLKITx_GMVUtility resourceSearchPaths:bundleName:]: unrecognized selector sent to class 0x103e78160
2022-10-09 14:01:16.969 Example[55121/0x16daff000] [lvl=3] +[MLKITx_CCTClearcutUploader crashIfNecessary] Multiple instances of CCTClearcutUploader were instantiated. Multiple uploaders function correctly but have an adverse affect on battery performance due to lock contention.
2022-10-09 14:01:16.969161+0900 Example[55121:11997752] +[MLKITx_GMVUtility resourceSearchPaths:bundleName:]: unrecognized selector sent to class 0x103e78160
2022-10-09 14:01:16.981413+0900 Example[55121:11997758] -[MLKITx_CCTClearcutLogger logCounters:]: unrecognized selector sent to instance 0x2838f1bd0
2022-10-09 14:01:16.981631+0900 Example[55121:11997758] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTClearcutLogger logCounters:]: unrecognized selector sent to instance 0x2838f1bd0'
*** First throw call stack:
(0x1b09f6248 0x1a9db7a68 0x1b0b6a3f0 0x1b0a0c360 0x1b0a74660 0x102cb938c 0x102cdae14 0x104f8e04c 0x104f9fe00 0x104f9f5d0 0x102cdad78 0x102cba848 0x102cb5f20 0x102cb2bf8 0x104f8c598 0x104f8e04c 0x104f960fc 0x104f96e24 0x104fa3cac 0x1fd314df8 0x1fd314b98)
libc++abi: terminating with uncaught exception of type NSException

This is only caused in Swift PM, not CocoaPods official. It seems to be missed some internal APIs official MLKit used.

d-date commented 1 year ago

Resolved: Add -ObjC and -all_load to Other Linker Flags in Xcode project