Someone help me please, I have added cocoapods to ...
# multiplatform
r
Someone help me please, I have added cocoapods to my KMP project, and when I try to run iOS, I get an error like this:
Copy code
The following build commands failed:

Copy /...../cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/nanopb_nanopb.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
......
My Podfile:
Copy code
# Uncomment the next line to define a global platform for your project
platform :ios, '16.0'
target 'iosApp' do
  # Comment the next line if you don't want to use dynamic frameworks
  #   use_frameworks!

  # Pods for iosApp
    pod 'composeApp', :path => '../composeApp'
#     pod 'GoogleSignIn', '8.0.0'

     pod 'GoogleMaps', '9.1.1'
     pod 'Google-Maps-iOS-Utils', '6.0.0'

end
I tried running a project which i cloned from Github with the same setup and it worked fine.
More stacktrace:
Copy code
Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/nanopb_nanopb.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/nanopb_nanopb.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/nanopb_nanopb.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/nanopb_nanopb.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/Promises_FBLPromises.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/Promises_FBLPromises.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/Promises_FBLPromises.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/Promises_FBLPromises.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/GoogleUtilities_GoogleUtilities-UserDefaults.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-UserDefaults.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-UserDefaults.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-UserDefaults.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/GoogleUtilities_GoogleUtilities-Reachability.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Reachability.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Reachability.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Reachability.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/GoogleUtilities_GoogleUtilities-AppDelegateSwizzler.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-AppDelegateSwizzler.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-AppDelegateSwizzler.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-AppDelegateSwizzler.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/GoogleUtilities_GoogleUtilities-Network.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Network.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Network.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Network.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/GoogleUtilities_GoogleUtilities-Logger.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Logger.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Logger.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Logger.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/GoogleUtilities_GoogleUtilities-NSData.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-NSData.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-NSData.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-NSData.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/GoogleDataTransport_GoogleDataTransport.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleDataTransport_GoogleDataTransport.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleDataTransport_GoogleDataTransport.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
  error: /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleDataTransport_GoogleDataTransport.bundle: No such file or directory (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
  
  Copy /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle/GoogleUtilities_GoogleUtilities-Environment.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Environment.bundle (in target 'GoogleMaps-GoogleMapsResources' from project 'Pods')
      cd /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/Pods
      builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleUtilities_GoogleUtilities-Environment.bundle /Users/roonyshekho/StudioProjects/fl_mob/composeApp/build/cocoapods/synthetic/ios/build/Debug-iphonesimulator/GoogleMaps/GoogleMapsResources.bundle
t
сс @Andrey Yastrebov
a
@Roony Shekho can you provide a minimal reproducer?
r
@Andrey Yastrebov I can't reproduce it in any other project. But in my project I have composeApp module, which is an entry point module, and I have cocoapods in my core module, which is the shared module. Placing cocoapods in composeApp only solved the issue, but that's not what I want.
a
It's better to use cocoapods only in top-level module,
composeApp
in your case
Also check our official sample, it has similar setup https://github.com/Kotlin/kmp-with-cocoapods-compose-sample
r
@Andrey Yastrebov I tried your sample but whenever I try to add any Pod, for example GoogleSignIn, I get this message:
[!] CocoaPods could not find compatible versions for pod "GoogleSignIn":
In Podfile:
GoogleSignIn (~> 8.0)
There are only pre-release versions available satisfying the following requirements:
'GoogleSignIn', '~> 8.0'
You should explicitly specify the version in order to install a pre-release version
I'm only replacing LoremIpsum with GoogleSignIn and changing the version to 8.0, what could be wrong here?
a
run
pod repo update
r
I've already tried that and it didn't fix it
a
try to set
8.0.0
strictly
Copy code
pod("GoogleSignIn") {
    version = "8.0.0"
    extraOpts += listOf("-compiler-option", "-fmodules")
}
r
Still getting the same error. Despite that, I can see these pods in Podfile.lock:
Copy code
PODS:
  - AppAuth (1.7.6):
    - AppAuth/Core (= 1.7.6)
    - AppAuth/ExternalUserAgent (= 1.7.6)
  - AppAuth/Core (1.7.6)
  - AppAuth/ExternalUserAgent (1.7.6):
    - AppAuth/Core
  - AppCheckCore (11.2.0):
    - GoogleUtilities/Environment (~> 8.0)
    - GoogleUtilities/UserDefaults (~> 8.0)
    - PromisesObjC (~> 2.4)
  - composeApp (1.0-SNAPSHOT):
    - GoogleSignIn (= 8.0.0)
  - GoogleSignIn (8.0.0):
    - AppAuth (< 2.0, >= 1.7.3)
    - AppCheckCore (~> 11.0)
    - GTMAppAuth (< 5.0, >= 4.1.1)
    - GTMSessionFetcher/Core (~> 3.3)
  - GoogleUtilities/Environment (8.1.0):
    - GoogleUtilities/Privacy
  - GoogleUtilities/Logger (8.1.0):
    - GoogleUtilities/Environment
    - GoogleUtilities/Privacy
  - GoogleUtilities/Privacy (8.1.0)
  - GoogleUtilities/UserDefaults (8.1.0):
    - GoogleUtilities/Logger
    - GoogleUtilities/Privacy
  - GTMAppAuth (4.1.1):
    - AppAuth/Core (~> 1.7)
    - GTMSessionFetcher/Core (< 4.0, >= 3.3)
  - GTMSessionFetcher/Core (3.5.0)
  - PromisesObjC (2.4.0)
a
Still getting the same error
Can you provide a reproducer? I can't help without it. Checked with my sample, and everything works as expected:
r
@Andrey Yastrebov Also note I did manage to make it work if I have LoremIpsum pod in your sample and my project, but if I add GoogleSignIn it gives me the error above.
a
It gives target error, not the same as above:
Specs satisfying the GoogleSignIn (= 8.0.0) dependency were found, but they required a higher minimum deployment target.
So you need just to add target constraint
ios.deploymentTarget = "16.6"
r
Yes it works now! Thank you very much.
👍 1