Hello, I've added the following Firebase dependenc...
# multiplatform
s
Hello, I've added the following Firebase dependencies to the cocopods under the
build.gradle.kts
iOS build fails with an error
Copy code
pod("FirebaseCrashlytics") {
            extraOpts += listOf("-compiler-option", "-fmodules")
        }

        pod("FirebaseCore") {
            extraOpts += listOf("-compiler-option", "-fmodules")
        }

        pod("FirebasePerformance") {
            extraOpts += listOf("-compiler-option", "-fmodules")
        }
Logs from the failing build in Xcode
Copy code
GoogleUtilities.build/Objects-normal/x86_64/Binary/Cheat\ Codes\ Pro.debug.dylib
  Undefined symbols for architecture x86_64:
    "_main", referenced from:
        ___debug_main_executable_dylib_entry_point in command-line-aliases-file
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
Copy code
> Task :composeApp:checkSandboxAndWriteProtection
> Task :composeApp:checkKotlinGradlePluginConfigurationErrors SKIPPED
> Task :composeApp:generateDefFirebaseCore UP-TO-DATE
> Task :composeApp:xcodeVersion UP-TO-DATE
> Task :composeApp:podGenIos UP-TO-DATE
> Task :composeApp:podInstallSyntheticIos UP-TO-DATE
> Task :composeApp:podSetupBuildFirebaseCoreIosSimulator UP-TO-DATE
> Task :composeApp:podBuildFirebaseCoreIosSimulator FAILED
error: Executing of 'xcodebuild -project Pods.xcodeproj -scheme FirebaseCore -destination generic/platform=iOS Simulator -configuration Debug' failed with code 65 and message: 

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':composeApp:podBuildFirebaseCoreIosSimulator'.
> Executing of 'xcodebuild -project Pods.xcodeproj -scheme FirebaseCore -destination generic/platform=iOS Simulator -configuration Debug' failed with code 65 and message: 
  
  Command line invocation:
      /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project Pods.xcodeproj -scheme FirebaseCore -destination "generic/platform=iOS Simulator" -configuration Debug
  
  User defaults from command line:
      IDEPackageSupportToolchainOverrideForManifestLoading = com.apple.dt.toolchain.XcodeDefault
      IDEPackageSupportUseBuiltinSCM = YES
  
  Build settings from command line:
      TOOLCHAINS = com.apple.dt.toolchain.XcodeDefault
f
Hello, try my alternative to cocoapods https://frankois944.github.io/spm4Kmp/. It’s working with firebase
s
@François You mean Firebase dependencies are pure Swift packages and thats that its causing the issue with the cocoapods?
f
Firebase are ObjC library
s
and ive added the mixpanel pods in objc which worked completely fine
Firebase are ObjC library
then, then completely confused why is this issue happening
spend last 3 hours cleaning cache, gradle sync, pod deintegrate, pod install and gradle sync
f
Yes, I understand, but I gave up with the dying CocoaPods. Can you give all the cocoapods config block ?
s
Sure, here
Copy code
cocoapods {
        // Required fields
        version = "1.0"
        summary = "Some description for a Kotlin/Native module"
        homepage = "Link to a Kotlin/Native module homepage"

        // Match target in Podfile
        ios.deploymentTarget = "15.4"

        // Specify path to Podfile
        podfile = project.file("../iosApp/Podfile")

        framework {
            baseName = "ComposeApp"
            isStatic = true
        }

        pod("Mixpanel") {
//            version = libs.versions.pods.firebase.performance.get()
            extraOpts += listOf("-compiler-option", "-fmodules")
        }

        pod("FirebaseCore") {
//            version = libs.versions.pods.firebase.performance.get()
            extraOpts += listOf("-compiler-option", "-fmodules")
        }

        pod("FirebaseAnalytics") {
//            version = libs.versions.pods.firebase.performance.get()
            extraOpts += listOf("-compiler-option", "-fmodules")
        }

        pod("FirebasePerformance") {
//            version = libs.versions.pods.firebase.performance.get()
            extraOpts += listOf("-compiler-option", "-fmodules")
        }

        pod("FirebaseCrashlytics") {
//            version = libs.versions.pods.firebase.performance.get()
            extraOpts += listOf("-compiler-option", "-fmodules")
        }

        xcodeConfigurationToNativeBuildType["CUSTOM_DEBUG"] = NativeBuildType.DEBUG
        xcodeConfigurationToNativeBuildType["CUSTOM_RELEASE"] = NativeBuildType.RELEASE
    }
but keeps getting this error
Copy code
Executing of 'xcodebuild -project Pods.xcodeproj -scheme FirebaseAnalytics -destination generic/platform=iOS Simulator -configuration Debug' failed with code 65 and message:
f
Sorry, I can’t help you much with the information you provide, I’m still proposing you the alternative for integrating ObjC library.
👍 1
h
Did you ever figure this our @Sagar Khurana?
s
@Haley Cunningham Nope, I added the dependency in the iOS project's
Podfile
instead of in the CocoaPods in the
build.gradle.kts
👍 1