cloudinary / cloudinary_ios

Cloudinary iOS SDK
MIT License
165 stars 106 forks source link

Could not build Objective-C module 'CLDCrypto' #92

Closed mafer-bc closed 6 years ago

mafer-bc commented 7 years ago

Hi, I'm trying to build my iOS app via Nevercode, a continuous integration tool, and I use CocoaPods to integrate Cloudinary iOS SDK.

My repository connects with the integration tool, so to build the app I push the Workspace files, which includes my project and the Pods.xcodeproj

And I keep getting this:

.../Pods/Cloudinary/Cloudinary/Frameworks/CLDCrypto/iphoneos/CLDCrypto.framework/module.map:2:10: header '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/i
PhoneOS10.3.sdk/usr/include/CommonCrypto/CommonCrypto.h' not found

 header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/CommonCrypto/CommonCrypto.h"
                                                                                                                      ^

.../Pods/Cloudinary/Cloudinary/Utils/CLDCryptoUtils.swift:25:8: could not build Objective-C module 'CLDCrypto'

import CLDCrypto
       ^

It looks like the Pod doesn't include the 'CLDCrypto' framework.

I've tried removing the pod, running 'pod install' to remove Cloudinary, I add the pod and install to add Cloudinary again, but any new file was added.

I also tried adding to my Project Settings -> General -> Linked Frameworks and Libraries the CLDCrypto.Framework, but I get the same error

I use the latest pod: 'Cloudinary', '~> 2.0', and Xcode 8.3.3

Any thoughts on what it could be, or why my project can't find the framework?

JeremieDaigle commented 7 years ago

I'm having the exact same issue, using CocoaPods and buildKite on a swift project.

Arcane discusses many solutions, but they seem to be in the podspec side of things. I've lost a complete days worth of work over this issue so far. :( I'm debating switching solutions for image uploading, as this is completely blocking my testing deployment automation. Please help!

ios

MaorGariv commented 7 years ago

Hi @mafer-bc and @JeremieDaigle ,

Thanks for reaching out.

We couldn't replicate this issue. Did you try to build it locally? If not, please try it with a clean project and see if it works. Also, make sure that you're getting the latest Cloudinary version (2.0.2)

Looking forward to your updates.

JeremieDaigle commented 7 years ago

I was using 2.0.2 and locally it works fine, but on build kite / using terminal scripts it fails. (I'm assuming xcode automatically resolves some of the dependency issues)

mafer-bc commented 7 years ago

Same thing, I'm using Cloudinary 2.0.2 It works ok with Xcode but not in Nevercode, it runs the app using a clear machine state so there aren't things cached

MaorGariv commented 7 years ago

Hey guys,

We've tried to replicate your using some CI tools but it worked for us. Please check out this basic sample project - https://github.com/nitzanj/CldTester

And these are the logs (Nevercode) - http://res.cloudinary.com/maor/raw/upload/v1503476716/b3afa22a-1a05-49f1-82ac-fe397ed09189.log

Buddybuild - http://res.cloudinary.com/maor/raw/upload/v1503476714/buddybuild_build_1_logs.txt

Can you please try to deploy this project and see how it goes?

Keep me posted.

Thanks, Maor

AndrewZhatkin commented 7 years ago

Hi everyone!

I had this issue when I renamed Xcode.app to Xcode.8.3.3.app. After app name was renamed to Xcode.app and CLDCrypto was built successfully.

I think updating of CommonCrypto.h path in "/Pods/Cloudinary/Cloudinary/Frameworks/CLDCrypto/iphoneos/CLDCrypto.framework/module.map" can help.

SMR commented 7 years ago

Hi EveryOne!

I am also facing same issue. I am using Xcode 9 . Please provide any solution

/Users/samarjeet/Desktop/IMP Architecture/VIPER-Sample-master/Pods/Cloudinary/Cloudinary/Frameworks/CLDCrypto/iphonesimulator/CLDCrypto.framework/module.map:2:10: Header '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/usr/include/CommonCrypto/CommonCrypto.h' not found /Users/samarjeet/Desktop/IMP Architecture/VIPER-Sample-master/Pods/Cloudinary/Cloudinary/Utils/CLDCryptoUtils.swift:25:8: Could not build Objective-C module 'CLDCrypto'

MaorGariv commented 7 years ago

Hi @SMR,

Did you try to deploy the project I've previously shared (https://github.com/nitzanj/CldTester)?

If the issue persists, please share steps to reproduce for us to further investigate the issue.

Thanks, Maor

kezzico commented 7 years ago

I had the same issue. It was triggered by updating Xcode from beta to GM Seed. It's looking for something in the 10.3 SDK, but I'm building for iOS11

kezzico commented 7 years ago

I was running v2.0.1 linked as a submodule. I think cleaning and re-running the build brought up this problem. I installed 2.0.2 through pods and it builds now.

tditchek commented 7 years ago

I'm experiencing the same issue. I updated to Xcode 9 and started getting the following error:

'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/CommonCrypto/CommonCrypto.h' not found

I've tried all of the following with no success:

Does anybody have a solution? Removing cloudinary from my app isn't possible as cloudinary is fully intertwined with our other platforms.

My best guess is the change from iOS 10.3 to iOS 11 is what's causing the problem, and it looks like the issue lies in the following lines:

module CLDCrypto [system] {
  header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/CommonCrypto/CommonCrypto.h"
  header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/CommonCrypto/CommonRandom.h"
  export *
}
rajat-Xprep commented 7 years ago

Hi , I am also facing the same issue that @tditchek is facing with both version 'Cloudinary', '~> 2.0.1', 'Cloudinary', '~> 2.0.2', I am using pod for adding dependency. Although I am running on iOS 10.3 but with Xcode 9.

VincentDengSZ commented 7 years ago

PhoneSimulatorxxx.sdk : change xxx to latest sdk installed in your xcode ,for example '11.0 .' there is one decimal number in xxx ,keep it in mind

fpena commented 7 years ago
nitzanj commented 7 years ago

We are working on a more stable solution, but in the meantime there's a workaround for those errors.

The required header files were created the first time Cloudinary was added to the pod file, so whichever target was used then - that is where the files will be. That directory should be something like /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/usr/include/CommonCrypto/

Both headers files (commonCrypto.h and commonRandom.h) need to be manually copied to the directory of the current target (iPhoneOS11.0.sdk, most probably). After that just verify that the module.map file(s) points to that same target directory as well (or manually edit it if that's not the case). This file is located in the project directory under all the targets used, e.g. ../Pods/Cloudinary/Cloudinary/Frameworks/CLDCrypto/iphonesimulator/CLDCrypto.framework/ and another copy may be under ../Pods/Cloudinary/Cloudinary/Frameworks/CLDCrypto/iphoneos/CLDCrypto.framework/. and so on.

Hope this helps, Nitzan

Brandogs commented 7 years ago

Hi @nitzanj I am trying to set up an old project on a new computer and don't have this path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk or any like it. I only have the latest target (iPhoneOS11.1sdk) and a generic target.

Is there another way I can go about trying this workaround?

vimalrick commented 7 years ago

@Brandogs For me also, I don't have "/iPhoneOS10.3.sdk" path. I have only "/iPhoneSimulator11.1.sdk" path.

in this case, in module.map just change "/iPhoneOS10.3.sdk" to "/iPhoneSimulator11.1.sdk", It will work fine.

"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/CommonCrypto/CommonCrypto.h"

"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneSimulator11.1.sdk/usr/include/CommonCrypto/CommonRandom.h"

deepakraj27 commented 7 years ago

Had the same issue just change it to iPhoneSimulator11.1 It will work

danhhgl commented 6 years ago

I updated to Xcode 9.2 and I got this error. So I changed to "iPhoneSimulator11.2.sdk" in the "module.map" file. And it worked again!

screen shot 2017-12-07 at 10 41 32 am
roeeba commented 6 years ago

Hey Guys. We've just published a Release Candidate for our iOS library - 2.0.4-rc1. This RC includes support for Swift 4 and the removal of CLDCryptoModule. Could you please install it and let us know if you see any issues?

pejalo commented 6 years ago

This solved the issue for me.

dvkch commented 6 years ago

Had the same issue when updated to Xcode 9.2 and 2.0.4-rc1 fixed it

SMR commented 6 years ago

Thanks for the solution.It is working in Xcode 9.2 .

roeeba commented 6 years ago

Closing this issue due to the time elapsed. Please feel free to either re-open the issue, contact our support at http://support.cloudinary.com or create a new ticket if you have any additional issues.

xdeleon commented 6 years ago

This issue resurfaced on my system. I am suing Xcode 9.4.1/Swift 3.3. Everything has been working for a while. I also had Xcode 10.1 beta 3 installed and using for other projects. Today I downloaded Xcode 10.1 GM. When I launched it asked for permission to set up more components and I said yes. After this I started receiving the above issue. I realized from the thread the issue was resolved in 2.0.4. Right now we can't upgrade to 2.0.4 since we'd have to take our app from Swift. 3.3 to 4 which we can't do at the moment.

Some additional notes. I had already named my versions of Xcode to "Xcode 9.4.1" and "Xcode beta 3" when everything was working fine. When I downloaded the Xcode 10.1 GM from the app store it was placed in my applications folder with the name Xcode. This is when the problems started. It appears the script might be using some hard coded value to look for "Xcode" in the app folder and not "Xcode 94.1", "Xcode. 10.1", etc.