I am not able to link GoogleSignIn with cinterop b...
# compose-ios
j
I am not able to link GoogleSignIn with cinterop bindings. This occurs when trying to run the app. I have added GoogleSignIn using spm. I’m able to link another package but not this one.
Copy code
ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: warning: Could not find or use auto-linked framework 'GoogleSignIn': framework 'GoogleSignIn' not found
Undefined symbols for architecture arm64:
  "_GoogleSignInVersionNumber", referenced from:
      _GoogleSignIn_GoogleSignInVersionNumber_getter_wrapper5 in shared[2](shared.framework.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Copy code
// Gradle 
compilations.getByName("main") {
            val GoogleSignIn by cinterops.creating {
                defFile("src/nativeInterop/cinterop/GoogleSignIn.def")
                val frameworkPath = "$rootDir/vendors/Firebase/GoogleSignIn"
                val googleSignInPath =
                    "$frameworkPath/GoogleSignIn.xcframework/ios-arm64"
                compilerOpts(
                    "-I/Users/macbookair/Downloads/Trackfit-Migration/vendors/includes",
                    "-F$googleSignInPath",
                    "-framework",
                    "GoogleSignIn",
                    "-rpath",
                    googleSignInPath,
                )
                extraOpts += listOf("-compiler-option", "-fmodules")
            }
        }
Copy code
// GoogleSignIn.def
language = Objective-C
modules = GoogleSignIn
linkerOpts = -framework GoogleSignIn
m
Hi @jamshedalamqaderi, I've also had the same issue. Could you let me know if you managed to find a solution?
j
After so many failures i've make it work then i have found this library https://github.com/mirzemehdi/KMPAuth . Currently i'm using this library
m
I am working on a totally different sdk. So can you tell me how you fixed the issue on the iOS part? Or what was causing the problem?
j
you have to link the framework on xcode
in gradle it's just for auto completion. we still need to add the complete framework as library in xcode
👍 1