Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error while generating docs for Objective-C framework #958

Closed
ChengappaMoEngage opened this issue Apr 25, 2018 · 6 comments
Closed

Comments

@ChengappaMoEngage
Copy link

ChengappaMoEngage commented Apr 25, 2018

I used the following command in my framework project's directory:
jazzy --objc --umbrella-header MoEngage/MoEngage.h --author "MoEngage Inc." --author_url "https://moengage.com" --github_url "https://github.com/moengage/MoEngage-iOS-SDK" --module "MoEngage" --module-version 4.0.1 --sdk iphone

Getting this Error :
xcodebuild: error: SDK "iphone" cannot be located. xcrun: error: unable to lookup item 'Path' in SDK 'iphone' warning: no such sysroot directory: '' [-Wmissing-sysroot] /Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/MoEngage/MoEngage.h:9:9: fatal error: 'Foundation/Foundation.h' file not found 63% documentation coverage with 42 undocumented symbols included 114 symbols building site building search index jam out ♪♫ to your fresh new docs in docs``

Am I missing something here?

@jpsim
Copy link
Collaborator

jpsim commented Apr 25, 2018

There is no iphone SDK. Did you mean iphonesimulator or iphoneos?

@ChengappaMoEngage
Copy link
Author

ChengappaMoEngage commented May 2, 2018

Sorry for the delay. I corrected the command to specify iphonesimulator. So, I tried to generate docs in two ways and getting error in both the cases.

One with my framework project :
Command Used : jazzy --objc --umbrella-header MoEFramework/MoEngage/MoEngage/MoEngage.h --author "MoEngage Inc." --author_url "https://moengage.com" --github_url "https://github.com/moengage/MoEngage-iOS-SDK" --module "MoEngage" --module-version 4.0.1 --sdk iphonesimulator

Error : /Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/MoEngage/MoEngage.h:26:9: fatal error: 'MoEngage/MOPayloadBuilder.h' file not found 62% documentation coverage with 44 undocumented symbols included 116 symbols building site building search index

Here MOPayloadBuilder.h is one of the public headers imported in umbrella header.

And I also tried with the framework created for CocoaPods :

Command Used : jazzy --objc --umbrella-header MoEngage/MoEngage.framework/Headers/MoEngage.h --author "MoEngage Inc." --author_url "https://moengage.com" --github_url "https://github.com/moengage/MoEngage-iOS-SDK" --module "MoEngage" --module-version 4.0.1 --sdk iphonesimulator --framework-root MoEngage --podspec MoEngage-iOS-SDK.podspec --xcodebuild-arguments --objc

Error :

I'm getting Please confirm that xcodebuild is building a Swift module, even though I'm mentioning --objc

Fetching podspec for `MoEngage-iOS-SDK` from `/Users/Chengappa/Documents/MoEngage/MoEngageCocoaPod`
Downloading dependencies
Installing MoEngage-iOS-SDK (4.0.1)
Generating Pods project
Skipping User Project Integration
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Running xcodebuild
Could not parse compiler arguments from `xcodebuild` output.
Please confirm that `xcodebuild` is building a Swift module.
Saved `xcodebuild` log file: /var/folders/84/x7w62tg940nfdtzb3_m8ltdm0000gn/T/xcodebuild-AFB0454B-3A24-4F33-A025-F7BEC01D03FE.log
Failed to generate documentation
/usr/local/lib/ruby/gems/2.3.0/gems/jazzy-0.9.2/lib/jazzy/executable.rb:36:in `execute_command': /usr/local/lib/ruby/gems/2.3.0/gems/jazzy-0.9.2/bin/sourcekitten ["doc", "--module-name", "MoEngage_iOS_SDK", "--", "-target", "MoEngage-iOS-SDK", "SWIFT_VERSION\\=\\\"4.0\\\""] (RuntimeError)

Running xcodebuild

Could not parse compiler arguments from `xcodebuild` output.

Please confirm that `xcodebuild` is building a Swift module.

Saved `xcodebuild` log file: /var/folders/84/x7w62tg940nfdtzb3_m8ltdm0000gn/T/xcodebuild-AFB0454B-3A24-4F33-A025-F7BEC01D03FE.log

Failed to generate documentation```


@johnfairh
Copy link
Collaborator

Stick with the first (non-podspec) form -- the command is missing the --framework-root parameter.

@ChengappaMoEngage
Copy link
Author

ChengappaMoEngage commented May 3, 2018

@johnfairh I added framework root as suggested by you but still getting error :
Command : jazzy --objc --umbrella-header MoEFramework/MoEngage/MoEngage/MoEngage.h --author "MoEngage Inc." --author_url "https://moengage.com" --github_url "https://github.com/moengage/MoEngage-iOS-SDK" --module "MoEngage" --module-version 4.0.1 --sdk iphonesimulator --framework-root MoEFramework/MoEngage

Error :

/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Debug-iphonesimulator/MoEngage.build/module.modulemap:1:18: error: redefinition of module 'MoEngage'
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Release-iphonesimulator/MoEngage.build/module.modulemap:1:18: note: previously defined here
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Debug-iphonesimulator/MoEngageAppFwk.build/module.modulemap:1:18: error: redefinition of module 'MoEngageAppFwk'
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Release-iphonesimulator/MoEngageAppFwk.build/module.modulemap:1:18: note: previously defined here
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Release-iphoneos/MoEngage.build/module.modulemap:1:18: error: redefinition of module 'MoEngage'
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Release-iphonesimulator/MoEngage.build/module.modulemap:1:18: note: previously defined here
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Release-iphoneos/MoEngageAppFwk.build/module.modulemap:1:18: error: redefinition of module 'MoEngageAppFwk'
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Release-iphonesimulator/MoEngageAppFwk.build/module.modulemap:1:18: note: previously defined here
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Debug-iphoneos/MoEngage.build/module.modulemap:1:18: error: redefinition of module 'MoEngage'
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Release-iphonesimulator/MoEngage.build/module.modulemap:1:18: note: previously defined here
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Debug-iphoneos/MoEngageAppFwk.build/module.modulemap:1:18: error: redefinition of module 'MoEngageAppFwk'
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/build/MoEngage.build/Release-iphonesimulator/MoEngageAppFwk.build/module.modulemap:1:18: note: previously defined here
/Users/Chengappa/Documents/MoEngage/MoEObjC/MoEFramework/MoEngage/MoEngage/MoEngage.h:26:9: fatal error: 'MoEngage/MOPayloadBuilder.h' file not found
62% documentation coverage with 44 undocumented symbols

As mentioned earlier ** MOPayloadBuilder.h is one of the public headers imported in umbrella header.**

@johnfairh
Copy link
Collaborator

Jazzy is just running the compiler against your umbrella header file with the include search path set to everything under the framework root directory. If that is not going to match 'MoEngage/MOPayloadBuilder.h' (etc.) then you may need to do some alias directory creation - see eg. #667. I think you have all the jazzy flags set correctly now, hopefully that explanation of what is happening is enough to let you work through the build issues.

@johnfairh
Copy link
Collaborator

Closing this one now.

iMacHumphries added a commit to willowtreeapps/Hyperion-iOS that referenced this issue May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants