https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
s

Sergio Casero

05/02/2020, 3:22 PM
Hello guys, I’m trying to develop one library that uses
FirebaseAuth
, but I have some problems with the iOS part, this is how my cocoapods plugin looks:
Copy code
cocoapods {
        summary = "Common library for using firebase auth"
        homepage = "TODO"
        isStatic = false

        pod("FirebaseAuth", "6.5.2")
    }
The thing is that the code is well recognized by the IDE and I can develop it without any problems, but when I try to compile the app with xcode, I get:
Copy code
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
            The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
            output:
            Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_FIRAuth", referenced from:
      objc-class-ref in result.o
ld: symbol(s) not found for architecture x86_64
If I change to a real device, I get similar output but with
arm
values Any idea?
k

kpgalligan

05/02/2020, 3:28 PM
What’s your cocoapods config in Xcode? You have to wire that up in Xcode as well to link properly.
s

Sergio Casero

05/02/2020, 3:33 PM
My Podfile
Copy code
# Uncomment the next line to define a global platform for your project
use_frameworks!
use_modular_headers!

platform :ios, '12.0'

target 'sample_ios' do
  pod 'FirebaseAnalytics'
  pod 'common', :path => '../common/'
end
And in other linker flags, I have
${inherit} and -ObjC
k

kpgalligan

05/02/2020, 3:36 PM
What does the
common.podspec
look like?
s

Sergio Casero

05/02/2020, 3:40 PM
The project is open source
Take a look if you prefer 🙂
k

kpgalligan

05/02/2020, 3:40 PM
Came up 404
s

Sergio Casero

05/02/2020, 3:41 PM
wups sorry, now should be solved
👍 1
It was private 😞
k

kpgalligan

05/02/2020, 3:49 PM
I have no idea where the thread is, but I wound up not using cocoapods for the cinterop because there was an issue with Firebase, and I think it was related to subspecs (Firebase/Something), but I never resolved it.
Currently trying to remember what I did here: https://github.com/touchlab/FirestoreKMP
s

Sergio Casero

05/02/2020, 3:51 PM
I'll try to take a look to your repo
k

kpgalligan

05/02/2020, 3:51 PM
Well, anyway. To test it out, I’d comment out the podspec dependency https://github.com/sergiocasero/kmp_auth/blob/master/common/common.podspec#L15
s

Sergio Casero

05/02/2020, 3:51 PM
Thanks ;)
k

kpgalligan

05/02/2020, 3:51 PM
Then add the FirebaseAuth directly in your Podfile. If that works, then it’s something in the way the podspec dependency is added.
Good luck. The interop config is not my favorite thing in KMP.
s

Sergio Casero

05/02/2020, 3:52 PM
Me too hahahaha
k

kpgalligan

05/02/2020, 3:53 PM
I wouldn’t look too hard at my sample. I just pulled the headers directly into the repo for the interop. Sort of a brute force way of doing it, and not very maintainable.
s

Sergio Casero

05/02/2020, 3:57 PM
Yes yes, this was the reason why I discard the cinterop without cocoapods haha
4 Views