SwiftKickMobile / SwiftMessages

A very flexible message bar for UIKit and SwiftUI.
MIT License
7.24k stars 741 forks source link

SwiftMessages_SwiftMessages.bundle: No such file or directory building from command line #453

Open Dario-GoldenSpear opened 3 years ago

Dario-GoldenSpear commented 3 years ago

Hi,

We are trying to use jazzy to generate the project's documentation but we are getting the following error:

PBXCp /Users/dario/Documents/Trabajo/Company/GitHub/ios-project-name-app/TargetName/build/Release-iphoneos/SwiftMessages_SwiftMessages.bundle /Users/dario/Documents/Trabajo/Company/GitHub/ios-project-name-app/TargetName/build/Release-iphoneos/AppName.app/SwiftMessages_SwiftMessages.bundle (in target 'TargetName' from project 'TargetName')
    cd /Users/dario/Documents/Trabajo/Company/GitHub/ios-project-name-app/TargetName
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/dario/Documents/Trabajo/Company/GitHub/ios-project-name-app/TargetName/build/Release-iphoneos/SwiftMessages_SwiftMessages.bundle /Users/dario/Documents/Trabajo/Company/GitHub/ios-project-name-app/TargetName/build/Release-iphoneos/AppName.app
error: /Users/dario/Documents/Trabajo/Company/GitHub/ios-project-name-app/TargetName/build/Release-iphoneos/SwiftMessages_SwiftMessages.bundle: No such file or directory (in target 'TargetName' from project 'TargetName')

And this is the full log: xcodebuild-swift-messages-error.log

This only happens when running xcodebuild, through jazzy, from the command line.

I can compile and run the application from Xcode, where the SwiftMessages_SwiftMessages.bundle is copied from a different path:

PBXCp /Users/dario/Library/Developer/Xcode/DerivedData/TargetName-btnplbbkwgnzpyaisjrbkqxzoqon/Build/Products/Debug-iphoneos/SwiftMessages_SwiftMessages.bundle /Users/dario/Library/Developer/Xcode/DerivedData/TargetName-btnplbbkwgnzpyaisjrbkqxzoqon/Build/Products/Debug-iphoneos/AppName.app/SwiftMessages_SwiftMessages.bundle (in target 'TargetName' from project 'TargetName')
    cd /Users/dario/Documents/Trabajo/GoldenSpear/GitHub/ios-project-name-app/TargetName
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/dario/Library/Developer/Xcode/DerivedData/TargetName-btnplbbkwgnzpyaisjrbkqxzoqon/Build/Products/Debug-iphoneos/SwiftMessages_SwiftMessages.bundle /Users/dario/Library/Developer/Xcode/DerivedData/TargetName-btnplbbkwgnzpyaisjrbkqxzoqon/Build/Products/Debug-iphoneos/AppName.app\

Any idea on how to solve the error? I am looking for a way to tell xcodebuild to use the same path that is used from Xcode.

Thanks in advance

wtmoose commented 3 years ago

I'm not sure when I would have time to try to replicate this. Do you have a sample project?

Dario-GoldenSpear commented 3 years ago

Hi @wtmoose

I have attached 2 zip files containing the same sample project, one version including SwiftMessages and the other not. In both cases I tried to generate the documentation executing the following command:

jazzy --min-acl private

You'll see a docs directory in the version not including SwiftMessages with the resulting generated documentation. The issue should be reproducible with any new empty project actually, just adding SwiftMessages using SPM should do the trick.

ObjectsDetector-NoSwiftMessages.zip ObjectsDetector-WithSwiftMessages.zip

log file for this project (the error is the same one already reported as far as I can see): xcodebuild-error.log

I think there is a problem with the source directory passed to PBXCp, when compiled from the Xcode it uses /DerivedData:

PBXCp /Users/dario/Library/Developer/Xcode/DerivedData/ObjectsDetector-dkjbmixbxfkluzbqwyiwnswjyjme/Build/Products/Debug-iphoneos/SwiftMessages_SwiftMessages.bundle /Users/dario/Library/Developer/Xcode/DerivedData/ObjectsDetector-dkjbmixbxfkluzbqwyiwnswjyjme/Build/Products/Debug-iphoneos/ObjectsDetector.app/SwiftMessages_SwiftMessages.bundle (in target 'ObjectsDetector' from project 'ObjectsDetector')
    cd /Users/dario/Desktop/ObjectsDetector-WithSwiftMessages
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/dario/Library/Developer/Xcode/DerivedData/ObjectsDetector-dkjbmixbxfkluzbqwyiwnswjyjme/Build/Products/Debug-iphoneos/SwiftMessages_SwiftMessages.bundle /Users/dario/Library/Developer/Xcode/DerivedData/ObjectsDetector-dkjbmixbxfkluzbqwyiwnswjyjme/Build/Products/Debug-iphoneos/ObjectsDetector.app

While from the command line it tries to get it from build/Release-...:

 PBXCp /Users/dario/Desktop/ObjectsDetector-WithSwiftMessages/build/Release-iphoneos/SwiftMessages_SwiftMessages.bundle /Users/dario/Desktop/ObjectsDetector-WithSwiftMessages/build/Release-iphoneos/ObjectsDetector.app/SwiftMessages_SwiftMessages.bundle (in target 'ObjectsDetector' from project 'ObjectsDetector')
    cd /Users/dario/Desktop/ObjectsDetector-WithSwiftMessages
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/dario/Desktop/ObjectsDetector-WithSwiftMessages/build/Release-iphoneos/SwiftMessages_SwiftMessages.bundle /Users/dario/Desktop/ObjectsDetector-WithSwiftMessages/build/Release-iphoneos/ObjectsDetector.app
error: /Users/dario/Desktop/ObjectsDetector-WithSwiftMessages/build/Release-iphoneos/SwiftMessages_SwiftMessages.bundle: No such file or directory (in target 'ObjectsDetector' from project 'ObjectsDetector')