1

I am going mad on how could I make this podspec work.

I'm developing a swift framework, CommonCrypto is needed. After many problems to make it work for every for every teams (Cordova, React), this is how CommonCrypto is implemented :

I got an aggregate target CommonCryptoModuleMap with a run script in its build phase :

if [ -d "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap" ]; then
echo "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap directory already exists, so skipping the rest of the script."
exit 0
fi

mkdir -p "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap"
cat <<EOF > "${BUILT_PRODUCTS_DIR}/CommonCryptoModuleMap/module.modulemap"
module CommonCrypto [system] {
    header "${SDKROOT}/usr/include/CommonCrypto/CommonCrypto.h"
    export *
}
EOF

But now, the goal is to implement it as a dependence of another Framework in Swift. So I have to specified the target dependency in the podspec.

I got no problem to build or archive it from Xcode.

Here is my Podspec :

Pod::Spec.new do |s|
  s.name               = "AFrameworkHasNoName"
  s.version            = "0.1.5"
  s.summary            = "Foo bar"
  s.homepage           = "https://github.com/MyRepository_ios"
  s.license            = "License"
  s.author             = { "Veesla" => "valentin.cousien@gmail.com" }
  s.source             = { :git => "git@github.com:MyRepository_ios.git", :tag => "develop" }
  s.swift_version      = "4.0"
  s.platform           = :ios, "8.0"
  s.requires_arc       = true
  s.exclude_files      = "AFrameworkHasNoNameTests/*"
  s.source_files       = "AFrameworkHasNoName/**/*.{h,m,swift}"
  s.module_name        = "AFrameworkHasNoName"
end

Here is the error :

- WARN  | source: The version should be included in the Git tag.
    - WARN  | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
    - WARN  | url: The URL (https://github.com/MyRepository_ios) is not reachable.
    - WARN  | [iOS] license: Unable to find a license file
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
    - ERROR | [iOS] xcodebuild:  MyFileImportingCommonCrypto.swift:10:8: error: no such module 'CommonCrypto'

Thanks for your responses

1 Answers1

1

Nevermind, It seems like I'm not the only failing to include CommonCrypto in a SDK included in another SDK.

I just bypass the problem by including CryptoSwift (using only pure Swift). It works perfectly for me. It's a bit heavy but you don't have to deal with modulemap files and C library... Pretty easy to work with, nice implementation

Here the link of CryptoSwift : https://github.com/krzyzanowskim/CryptoSwift

Hope it will help one of you !

PS : can anyone explain me why did I get down voted ? :(