Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 621 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'No such module' when I use CocoaPods

#21
I faced the same problem in a swift framework I developed. The framework had a dependency of git project and the framework itself added as a pod to my main project. So, ideally the dependency has been specified in podspec file and Podfile as well.

I didn't faced the problem when accessing through the my main project but when I open the framework standalone it was throwing "No such module" error.

The root cause is, the base configurations is set with the path which points towards my main project instead of the framework itself because I ran podinstall first in my main project and then in the framework project.

Eg: in the project file it was like
0091AB0C861D71C94ADD7240 /* Pods-myframework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-myframework.release.xcconfig"; **path = "../../Apps/MyMainProject/Pods/Target Support Files/Pods-myframework/Pods-myframework.release.xcconfig"**; sourceTree = "<group>"; };

After doing the below mentioned fix,
4444F5B1B35F066E57F96782 /* Pods-myframework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-myframework.release.xcconfig"; path = **"Pods/Target Support Files/Pods-myframework/Pods-myframework.release.xcconfig"**; sourceTree = "<group>"; };


To fix the error,

1. Project file -> Configurations -> Set all the configurations set to
none.
2. Remove Pods folder and Podfile.lock.
3. Run 'pod install' first in the framework project direcory and then do pod install in main project directory.
Reply

#22
Try using **pod update** after pod install command which will solve problem of **No such module**.
I just tried and it working fine.

Thanks,
Ratneshwar
Reply

#23
Adding link "c++" in the framework module.modulemap file worked for me
Reply

#24
Not sure if this would still be helpful for others. But, in my case, it ended up being a silly mistake of not referencing dependencies from the .podspec file.

We have an application with multiple internal libraries, and those libraries also have dependencies on each other - which we accounted for the in the Podfiles... but NOT in the podspecs.

So, even though our Podfiles had:

**Application / Podfile**

# Development Pods
pod 'ConsumingLibrary ', :path => '../ios-consuming-lib'
pod 'DependentLibrary1', :path => '../ios-library-one'
pod 'CommonCoreLibrary', :path => '../ios-common-core-lib'

**ConsumingLibrary / Podfile**

# Development Pods
pod 'DependentLibrary1', :path => '../ios-library-one'
pod 'CommonCoreLibrary', :path => '../ios-common-core-lib'


Needed to also call it out in the .podspec's:

**ConsumingLibrary / ConsumingLibrary.podspec**

# TODO
# Add here any resources to be exported.

s.dependency 'DependentLibrary1', '~> 0.1.0-RC'

**DependentLibrary1 / DependentLibrary1.podspec**

# TODO
# Add here any resources to be exported.

s.dependency 'CommonCoreLibrary', '~> 0.1.0-RC'


I think I wasted about 2 hours trying to figure out why I could build ConsumingLibrary & run tests, but as soon as I built the app, that consumed all three libraries - I kept getting:

> No such module 'DependentLibrary1'
Reply

#25
Sometimes happens when you have an **obj-c** pod within a **swift** project (even when you use the `use_frameworks!` in the `.podfile`).

If you're sure the *pod* is installed and you are still getting *No such module*, try this:

- Go to *Pods* project in Xcode
- *Pods*
- Right click on the affected *pod*
- *Show in finder*

There should be a package file with *.framework* suffix. Create a folder *Modules* in it. In this folder create a file called *module.modulemap* with code:

framework module MODULE_NAME_HERE {
umbrella header "MODULE_NAME_HERE.h"

export *
module * { export * }

link framework LINKED_FRAMEWORKS_AND_LIBRARIES_THE_POD_NEEDS_HERE
link framework "AdSupport"
link "c++"
link "z"
}

**Rebuild** and you should be ok.
Reply

#26
You must reopen project .xcworkspace file(not .xcodeproj) after install your podfile.

1. Clone the repo with CocoaPods
2. Open YourWorkspace/YourApplication.xcworkspace
3. Select the app u want to run Add SwiftyJSON.framework in embedded
binaries for that project Hit Run

Happy Coding :)
Reply

#27
You may also try re-installing pods using:

pod deintegrate

and then

pod install

This fixed this issue for me
Reply

#28
Press **Command+Option+Shift+K** and then **Run** your app, you will see a magic.

Or from the menu -> Product, press Option on your keyboard and you'll see Clean Build Folder.

It's looking funny that how could Xcode do those things with us but same thing happened to me when I used a Swift library using Pod and after too much struggle I ended up with Clean Build Folder.
Reply

#29
For using Swift in Objective-C, you should import a header file that Xcode generates automatically in compile time (NameOfModule+Swift.h). In this case, you should try import SwifityJSON in you header file like this:

#import "SwiftyJSON-Swift.h"
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through