What is `symbol multiply defined!` ? and how can ...
# kotlin-native
a
What is
symbol multiply defined!
? and how can i resolve this ? I am using a pod in a
library project A
and now i have declared the pod in my
Main Project
which uses this
library A
so that the framework is found in the runtime but the compilation fails with the following
Copy code
Compilation failed: Linking globals named 'knifunptr_cocoapods_GRPCClient8_TransportIDIsEqual': symbol multiply defined!
This might help, not sure 🤔 will try tomorrow
k
Symbol multiply defined means you have the same binary linked twice. Assuming it's from that pod, then it's getting dragged in twice. Posting your build files would help
a
This is the Main library’s build dir.
this is the build dir of the repo where i have imported the Main library
I am configuring the cocoapods again in my Repo like this👇🏻
Copy code
cocoapods {
        ios.deploymentTarget = "14.0"
        pod("gRPC-ProtoRPC", moduleName = "GRPCClient")
        pod("Protobuf")
    }
If i don’t include this, then the build fails with
Copy code
Undefined symbols for architecture x86_64:
  "_GPBComputeBoolSize", referenced from:
      _cocoapods_Protobuf_GPBComputeBoolSize_wrapper53 in result.o
  "_GPBComputeEnumSize", referenced from:
      _cocoapods_Protobuf_GPBComputeEnumSize_wrapper91 in result.o
  "_GPBComputeInt32Size", referenced from:
      _cocoapods_Protobuf_GPBComputeInt32Size_wrapper50 in result.o
  "_GPBComputeInt64Size", referenced from:
      _cocoapods_Protobuf_GPBComputeInt64Size_wrapper49 in result.o
In the Main library it’s configured as
Copy code
cocoapods {
        version = "1.0"
        summary = "*"
        homepage = "*"
        framework {
            baseName = "GRPCKotlinMultiplatform"
        }

        ios.deploymentTarget = "14.0"

        pod("gRPC-ProtoRPC", version = "~> 1.49.0", moduleName = "GRPCClient")
        pod("Protobuf", version = "~> 3.21.6", moduleName = "Protobuf")
        //pod("gRPC-Core")
    }
662 Views