0

I am trying to create a pod of library. I am following this tutorial. Pod lint successfully validate the pod spec. However when i import it as module i get error Use of unknown type. Here is the project

Update:

  • I just created a new pod project using the command pod lib create MZDownloadManager.
  • Then I updated the meta in podspecs file like description, summary etc.
  • Then I validated the podspecs using the command pod lib lint MZDownloadManager and it gives success.
  • Then I goto the Example project directory and run the command pod install.
  • It also successfully integrated the development pod.
  • Then I goto the pregenerated class ReplaceMe and created the test class named ReplaceMe and just define its testing initialiser.
  • Then I import the module. I still got the same error of Use of undeclared type

enter image description here

podspec file looks like this:

enter image description here

enter image description here

Muhammad Zeeshan
  • 2,441
  • 22
  • 33

2 Answers2

0

Finally I figured out the issue after spending so many hours. The problem was that my classes in my development pod is not declared as public and docs clearly states that:

It's worth mentioning here, as this catches people quite often, a Swift library needs to have it's classes declared as public for you to see them in your example library.

I hope this will save time of other developers facing similar issue.

Muhammad Zeeshan
  • 2,441
  • 22
  • 33
-1

Please make sure that your target membership is selected.

To see the target membership. Select your file then open the file inspector (⌥ + ⌘ + 1) [option] + [command] + 1

Also remove extra build phases.check bundle resources.Please do check whether you have assigned same variable name or same method name with MZDownloadManager.If so replace with some other name and run.

Do clean,build and then Run..

Arun
  • 624
  • 4
  • 18
  • then the problem must be on bundle resources.check it out.If you have any copy on build phases Do remove it and clean,build and Run – Arun Apr 26 '16 at 11:20
  • I think something is wrong with public source files. – Muhammad Zeeshan Apr 27 '16 at 06:04
  • I think you have assigned same method name or some variable name with the name of MZDownloadManager.Change if any and run the project,Because you have you pod file perfect.so i am sure the issue is on source file. – Arun Apr 27 '16 at 07:05