SimonErm/react-native-job-queue

Problem running on Simulator on iOS: not found for architecture arm64

romonsalve opened this issue · 2 comments

Hi,
First of all, thanks for your work.
On Android and iOS devices the library works great.

Unfortunately, it seems that the library is not working on M1 Simulators

Here is some of the outputs when compilation fails

"Swift._bridgeAnythingToObjectiveC<A>(A) -> Swift.AnyObject", referenced from:
      reabstraction thunk helper from @callee_unowned @convention(block) (@unowned Swift.AnyObject?) -> () to @escaping @callee_guaranteed (@in_guaranteed Any?) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
  "(extension in Swift):Swift.Error._domain.getter : Swift.String", referenced from:
      protocol witness for Swift.Error._domain.getter : Swift.String in conformance react_native_job_queue.SQLiteError : Swift.Error in react_native_job_queue in libreact-native-job-queue.a(SQLiteDatabase.o)
  "type metadata for Any", referenced from:
      react_native_job_queue.JobQueue.init() -> react_native_job_queue.JobQueue in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.addJob([Swift.String : Any]) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      @objc react_native_job_queue.JobQueue.addJob([Swift.String : Any]) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.removeJob([Swift.String : Any]) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      @objc react_native_job_queue.JobQueue.removeJob([Swift.String : Any]) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.removeJobsByWorkerName(Swift.String) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.updateJob([Swift.String : Any]) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      ...
  "__swift_FORCE_LOAD_$_swiftCoreFoundation", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreFoundation_$_react_native_job_queue in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      __swift_FORCE_LOAD_$_swiftCoreFoundation_$_react_native_job_queue in libreact-native-job-queue.a(Job.o)
      __swift_FORCE_LOAD_$_swiftCoreFoundation_$_react_native_job_queue in libreact-native-job-queue.a(SQLiteDatabase.o)
      __swift_FORCE_LOAD_$_swiftCoreFoundation_$_react_native_job_queue in libreact-native-job-queue.a(SQLTable.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreFoundation_$_react_native_job_queue)
  "Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String", referenced from:
      react_native_job_queue.JobQueue.init() -> react_native_job_queue.JobQueue in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      default argument 1 of Swift.print(_: Any..., separator: Swift.String, terminator: Swift.String) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      default argument 2 of Swift.print(_: Any..., separator: Swift.String, terminator: Swift.String) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.addJob([Swift.String : Any]) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.removeJob([Swift.String : Any]) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.removeJobsByWorkerName(Swift.String) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.updateJob([Swift.String : Any]) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      ...
  "value witness table for Builtin.NativeObject", referenced from:
      full type metadata for react_native_job_queue.SQLiteDatabase in libreact-native-job-queue.a(SQLiteDatabase.o)
  "Swift.Array.startIndex.getter : Swift.Int", referenced from:
      react_native_job_queue.JobQueue.getJobsForWorker(_: Swift.String, count: Swift.Int, resolve: (Any?) -> (), reject: (Swift.String?, Swift.String?, Swift.Error?) -> ()) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.getJobs(_: (Any?) -> (), reject: (Swift.String?, Swift.String?, Swift.Error?) -> ()) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.getActiveMarkedJobs(_: (Any?) -> (), reject: (Swift.String?, Swift.String?, Swift.Error?) -> ()) -> () in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
  "_swift_beginAccess", referenced from:
      react_native_job_queue.JobQueue.db.getter : react_native_job_queue.SQLiteDatabase? in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.db.setter : react_native_job_queue.SQLiteDatabase? in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.db.modify : react_native_job_queue.SQLiteDatabase? in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
      react_native_job_queue.JobQueue.init() -> react_native_job_queue.JobQueue in libreact-native-job-queue.a(JobQueue-e01e3ee236f1cdccbc3f96272134e4089550f5376c89e0947f2296357c650634.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

I think the key is this line "ld: symbol(s) not found for architecture arm64", but i I'm not sure if it's a problem with this library or with Swift Sqlite

I'm not sure how to help, but I'm glad to help and provide a PR, just i have little experience with Swift.

Thanks!

Hey,
i don't have a m1 mac to reproduce this and i am also not sure if this bug is related to this library or maybe the project setup.

Maybe one of the following links may help fixing this:
firebase/firebase-ios-sdk#6520
https://stackoverflow.com/questions/64171400/xcode-12-build-error-on-firanalyticsconnector/64183786#64183786
https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-an-object-file-built-for-io/64139830#64139830

They handle different error-logs but are also relateted to arm and simulator problems.

Maybe it's a problem like #49