Issues after installation through Cocoa Pod


#1

We added Cocoa Pod and now in the file where we are importing the Affdex library, it says, no module found. This is after we deleted the previous module (which was added manually, according to the previous installation process). What should we do next?


#2

Sumesh, please post the content of your Podfile here.


#3

As requested, you can find the the contents of the Pod file here:

 platform :ios, '9.0'
  source 'https://github.com/CocoaPods/Specs.git'
  use_frameworks!
     target 'NewTrueEmoji' do
   pod 'AffdexSDK-iOS'
  end

#4

Sumesh, I quickly tried your Podfile (replacing the target name only) and got the following output:

Analyzing dependencies
Downloading dependencies
Installing AWSCore (2.5.9)
Installing AWSKinesis (2.5.9)
Installing AffdexSDK-iOS (3.2.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `test.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 3 total pods installed.

Did you get similar output? Also note that CocoaPods creates a .xcworkspace workspace file. You should open that in Xcode, and no longer use the .xcodeproj project file.


#5

You can also check the CocoaPods guide for additional info.


#6

Exactly what we got. We were finally able to get it running. We uninstalled and installed everything related to CocoaPod, again. Then we moved the downloaded Affdex library to the root of the project folder. Vola! It worked.

PS: We faced another problem after the installation, it was to do with compatibility of AWSCore with Xcode 9 (check the screenshot.)

That was fixed by adding ‘%s’, as ssen in the code hereunder.

switch (logMessage->_flag) {
case AWSDDLogFlagError     :
           os_log_error(OS_LOG_DEFAULT, "%s", msg);
           break;
       case AWSDDLogFlagWarning   :
       case AWSDDLogFlagInfo      :
           os_log_info(OS_LOG_DEFAULT, "%s", msg);
           break;
       case AWSDDLogFlagDebug     :
       case AWSDDLogFlagVerbose   :
       default                 :
           os_log_debug(OS_LOG_DEFAULT, "%s", msg);
           break;
   }

#7

Awesome work @sumesh_dugar. This is on Amazon’s side. They don’t officially support Xcode9 yet as you can see here


#8

I see. Thanks for the answers. I am, however, left with one query. Why did the Cocoa Pod Affdex library refer itself and why we had to add Affdex to the root of the project to get it working?


#9

Sumesh,

You should not have to add the Affdex framework to the project. CocoaPods does the work of creating the xcworkspace file and adding the reference to the Affdex framework itself in your project.


#10

Yup, we had all the necessary files and directories through Cocoa Pod in our Xcworkspace, however, the error ‘no module found’ dint go away in the views we were trying to import Affdex to. Then we copied the affdex framework to the root and the error went away.

Things are working and good now, just wanted to know why the above step was necessary.


#11

Sumesh,

I would need to see the project to comment exactly. Are you using Swift or Objective-C?


#12

The project is on Swift.


#13

Can you create a sample project with the problem and share it with us? It really shouldn’t matter if you’re using Swift or Objective-C. CocoaPods should handle all the configs for you.


#14

Sure, Give me a couple of days, I shall test on a new project and share
with you.


#15

Tried loading pod on a fresh project, worked very well. I guess it was some issue with the setup of the older project.


#16

I have another issue with the Cocoa Pod installation.
First of all some pre-knowledge, I am developing in Objective-C, I have bit code enabled.

Now just after finishing installation I open the project workspace and get the following crash log as soon as I run on my device.

dyld: Library not loaded: @rpath/AWSCore.framework/AWSCore
  Referenced from: /private/var/containers/Bundle/Application/70BA2504-4BCC-4B3C-91B9-26EFD0F57362/Frameworks/Affdex.framework/Affdex
  Reason: image not found

I read some threads on Cocoapod and other frameworks on why might this happen and it turned out it might be from the Bitcode. Thus I said okay I’ll create a new project remove the bitcode part of the podfile for the post install, and disable bitcode from the project and give it another try. However, even after that I kept on getting this same error. The weirdest part is that I downloaded the test sample from github, ran a pod install on that project and everything worked perfectly with no crash. Now there was one thing I noticed different however from the github project and mine.

The github project had the the Linked Frameworks and libraries pod as:
- Pods_CameraTest.framework

On the other hand my project had libPods-AppName.a

Not sure if this makes a difference or not.

Thank you very much for your time in advance. I’ll keep on trying to solve this, but if there is a known quick solution would be very grateful.


#17

Hey @serj_agopian, Do you still have any issues with your installation?


#18

No, everything working fine! If I remember correctly I had to include
use_frameworks! eventhough I was using Objective-c. I think the AWSCore
framework required it.


#19