https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

Amritansh

12/07/2020, 7:49 PM
Hey, I am trying to add a pod dependency in my KMM project but I am getting an error when I am syncing
Copy code
Executing of 'pod gen --platforms=ios --gen-directory=/Users/atripathi/<Project Root>/shared/build/cocoapods/synthetic/iosArm64 dogtag.podspec' failed with code 1 and message:
[!] Unknown command: `gen`
Did you mean: env?
Copy code
cocoapods {
    frameworkName = "shared"
    pod("Connectivity")
}
I should also specify here that the first step mentioned here https://kotlinlang.org/docs/reference/native/cocoapods.html#install-the-cocoapods-dependency-manager-and-plugin is failing for me when I run the command so I used`brew install cocoapods`
Copy code
ERROR:  Error installing cocoapods:
        ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.13.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20201207-63679-1jx757c.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.13.1 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/ffi-1.13.1/gem_make.out
my project is working fine on iOS when I remove pod() dependency. I am kind of confused here where things are going wrong
a

Artyom Degtyarev [JB]

12/08/2020, 6:56 AM
Hello, @Amritansh! As far as I can see, this is about cocoapods installation. As you have to install it before using in KMM project. Please take a look at those stackoverflow questions, which seems to be related: one, two.
a

Amritansh

12/08/2020, 12:43 PM
@Artyom Degtyarev [JB] this solution worked for me Docker for Mac - mkmf.rb can't find header files for ruby. Thanks
👍 1
@Artyom Degtyarev [JB] my Android studio is not able to resolve this dependency(Connectivity) when I import it but it compiles and run without any build error. Is this expected?
a

Artyom Degtyarev [JB]

12/08/2020, 1:22 PM
Most probably, this is because
ios()
target shortcut was used. See this discussion: https://youtrack.jetbrains.com/issue/KT-42319
👍 1
🙏 1