OK, I'm at my whits end, struggling after updating...
# ios
c
OK, I'm at my whits end, struggling after updating the CMP Firebase Lib, now I get:
Copy code
Showing All Issues
java.lang.Error: Linking globals named 'kniprot_cocoapods_FirebaseAuth0_FIRUserInfo': symbol multiply defined!
when building iOS app, I've double check pods/spm, deps etc. Blown everything away then rebuild/imported etc
s
Maybe this will help: https://youtrack.jetbrains.com/issue/KT-50077/Linking-pods-error-on-Kotlin-1.6.0 Also provide your build.gradle.kts and versions so people may be able to help you better.
c
Yeah the main issue is that I do that move the pods out, then I go from
multiply defined
to now I get:
ld: framework 'FirebaseAuth' not found
Rock and hard place achieved...
Copy code
cocoapods {
        version = "1.0.0"
        ios.deploymentTarget = "14.1"
        framework {
            baseName = "shared"
            isStatic = false
            podfile = project.file("../iosApp/Podfile")
            transitiveExport = false
            binaryOption("bundleId", "co.haynet.shared")
            export("com.arkivanov.decompose:decompose:${libs.versions.decompose.get()}")
            export("com.arkivanov.essenty:lifecycle:${libs.versions.essenty.get()}")
            export("com.arkivanov.essenty:back-handler:${libs.versions.essenty.get()}")
            export("io.sentry:sentry-kotlin-multiplatform:${libs.versions.sentry.kmp.get()}")
            linkerOpts("-lsqlite3")
        }
        pod("FirebaseCore") {
            version = "11.4.0"
        }
//        pod("FirebaseAuth") {
//            version = "11.4.0"
//            extraOpts += listOf("-compiler-option", "-fmodules")
//        }
        pod("FirebaseAnalytics") {
            version = "11.4.0"
            extraOpts += listOf("-compiler-option", "-fmodules")
        }
//        pod("FirebaseMessaging") {
//            version = "11.4.0"
            ///extraOpts += listOf("-compiler-option", "-fmodules")
//        }
        pod("Sentry") {
            // Check the version compatibility table for the correct version
            version = "8.36.0"
            linkOnly = true
            extraOpts += listOf("-compiler-option", "-fmodules")
        }
        pod("StripeCore") {
            version = "~> 23.32.0"
            extraOpts += listOf("-compiler-option", "-fmodules")
        }
        pod("libPhoneNumber-iOS")
    }
s
Did u see that flag "linkOnly" in the pod dependency declaration function
c
Yeah tried that, get a different error, lemme run and grab that one...
f
Did you try this way ?(advertisement myself 😛)
c
No, lemme look 🙂
So the linkOnly method gets:
Copy code
Showing All Issues
Undefined symbols for architecture arm64:

  "_FIRInstallationIDDidChangeNotification", referenced from:

      +[FIRAnalytics observeFirebaseInstallationIDChanges] in FirebaseAnalytics[arm64][10](FIRAnalytics.o)

  "_GULIsLoggableLevel", referenced from:

      -[APMMonitor isLoggableLevel:] in GoogleAppMeasurement[arm64][69](APMMonitor.o)

  "_GULOSLogBasic", referenced from:

      -[APMASLLogger logMessage:logTag:messageCode:withLogLevel:] in GoogleAppMeasurement[arm64][12](APMASLLogger.o)

  "_GULOSLogError", referenced from:

      -[APMPersistentDictionary initWithFileName:] in GoogleAppMeasurement[arm64][262](APMPersistentDictionary.o)

      _APMWriteDictionaryToURL in GoogleAppMeasurement[arm64][262](APMPersistentDictionary.o)

      -[APMUserDefaults synchronize] in GoogleAppMeasurement[arm64][316](APMUserDefaults.o)

  "_GULOSLogInfo", referenced from:

      ___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement[arm64][335](UIViewController+APMScreenClassName.o)

  "_GULOSLogWarning", referenced from:

      +[APMMeasurement sharedInstance] in GoogleAppMeasurement[arm64][62](APMMeasurement.o)

      -[APMPersistentDictionary objectForKey:] in GoogleAppMeasurement[arm64][262](APMPersistentDictionary.o)

      -[APMPersistentDictionary setObject:forKey:] in GoogleAppMeasurement[arm64][262](APMPersistentDictionary.o)

      -[APMUserDefaults objectForKey:] in GoogleAppMeasurement[arm64][316](APMUserDefaults.o)

      -[APMUserDefaults setObject:forKey:] in GoogleAppMeasurement[arm64][316](APMUserDefaults.o)

      -[APMUserDefaults synchronize] in GoogleAppMeasurement[arm64][316](APMUserDefaults.o)

      ___44+[UIViewController(APMScreenClassName) load]_block_invoke in GoogleAppMeasurement[arm64][335](UIViewController+APMScreenClassName.o)
Lemme looks at Francois
f
Maybe I’m getting lucky to have some feedback 😄
c
You use swift export method which I'm not
I would like to switch to, but the hellscape which is KMP and iOS dev doesn't let me yet
f
So SPM is not an option for you?
c
I wish
f
Stuck in a dying CocoaPods, 😭
c
Yeah, no kidding, the icons don't even load on the CP site now!
f
anyway, for your current config, can you move to
isStatic = true
?
c
Yeah trying that now
Seems to be getting further
f
in dynamic, you need to explicitly add all firebase require dependency as linkOnly
c
I mean, is there anything there stopping me using SPM export? I think before firebase didn't support it when I started, but now it does
f
You can use both CocoaPods and my plugin.
c
Lemme get this working as I need to cut a release then I'll try in a different branch
f
All your cocoa deps are SPM compatible, you can try the other way. I would like to know if my work is helpful 😄
c
Finally got it to run,
🎉 2
combination of linkOnly + static = true + adding pods to the iOS project got i there
FML
Deffo should move to SPM clearly
j
@François you convinced me! I'm trying your lib today for my Firebase CMP App 🙂
🎉 2
f
@Jimmy Nelle Tell me what you’re thinking about my plugin on PM 😄
👍 1