Hello, I am currently trying to make a multiplatfo...
# multiplatform
k
Hello, I am currently trying to make a multiplatform library for our android and ios applications. I have everything except I want to pull in the Firebase SDK for ios using cinterop. I have everything hooked in and working except when I build the linker gives me the following error.
Copy code
Undefined symbols for architecture arm64:
  "___isOSVersionAtLeast", referenced from:
      +[GULAppEnvironmentUtil isAppStoreReceiptSandbox] in GoogleUtilities(GULAppEnvironmentUtil.o)
  "_utf8_nextCharSafeBody", referenced from:
      -[FSRWebSocket _innerPumpScanner] in FirebaseDatabase(FSRWebSocket.o)
ld: symbol(s) not found for architecture arm64
Copy code
cinterops {
                    firebase {

                        includeDirs {
                            allHeaders "${carthageDir}/FirebaseCore.framework/Headers",
                                    "${carthageDir}/FirebaseDatabase.framework/Headers",
                                    "${carthageDir}/FirebaseAnalytics.framework/Headers"
                        }

                        compilerOpts "-F${carthageDir}"
                    }
                }
                linkerOpts "-F${carthageDir}"
Copy code
language = Objective-C
headers = FirebaseDatabase.h FirebaseCore.h
compilerOpts = -framework FirebaseDatabase -framework Firebase -framework FirebaseCore -framework leveldb-library -framework GoogleUtilities -framework GoogleAppMeasurement -framework FIRAnalyticsConnector -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework nanopb -framework FirebaseAnalytics
linkerOpts = -framework FirebaseDatabase -framework Firebase -framework FirebaseCore -framework leveldb-library -framework GoogleUtilities -framework GoogleAppMeasurement -framework FIRAnalyticsConnector -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework nanopb -framework FirebaseAnalytics
o
there are explanations in https://jonnyzzz.com/blog/2018/06/13/link-error-3/, essentially this is a linker problem we will try to fix in upcoming releases
s
This link covers the first undefined symbol,
___isOSVersionAtLeast
.
_utf8_nextCharSafeBody
issue is likely to disappear after adding
-licucore
to
linkerOpts
.
k
Thanks! Glad to hear a fix is coming and I'll try these workarounds for now.