5 Replies
      Latest reply: Oct 21, 2016 11:49 PM by StarGazerI RSS
      StarGazerI Level 1 Level 1 (0 points)

        I have a framework that I am trying to embed in an application.

        The framework uses cmake to build itself, and I can rebuild as needed to fix this problem.

        When I include the library in my application, with Code Sign On Copy checked, the step fails with a file not found.  Tracing the output, it is trying to sign a library at Versions/A.   The library should have a version of 1.10.0, and when doing otool it reports the version numbers as 1.10.0.

        So, where does xcode get that A for the version when trying to sign the library?  What can be changed so it has the right version number?

        • Re: copy on code sign, where does version come from?
          eskimo Apple Staff Apple Staff (7,485 points)

          Lemme get this straight, your framework looks like a standard framework:

          xxx.framework/
          xxx.framework/Resources -> Versions/Current/Resources
          xxx.framework/xxx -> Versions/Current/xxx
          xxx.framework/Versions/
          xxx.framework/Versions/Current -> A
          xxx.framework/Versions/A
          xxx.framework/Versions/A/Resources/
          xxx.framework/Versions/A/Resources/Info.plist
          xxx.framework/Versions/A/xxx
          

          except that everywhere I’ve written A you have 1.10.0.  Is that right?

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: copy on code sign, where does version come from?
              StarGazerI Level 1 Level 1 (0 points)

              That is correct.

              The A should be 1.10.0.  The framework looks like the above where all the A's are 1.10.0.

               

              But the sign action tries to sign a (non-existent) Versions/A directory.

              otool only shows 1.10.0, no A anywhere.  I don't know where else to look.  The directory looks right, the build project has the various versions set to 1.10.0, but something somewhere still seems to want it to be version A.

               

              And yes, 1.10.1 is not compatible.  Thus the 1.10.0 for compatible version for this library.  This is a cross platform library built as framework for OSX and iOS, and the version tag is what it is to cover all platforms.

                • Re: copy on code sign, where does version come from?
                  eskimo Apple Staff Apple Staff (7,485 points)

                  This is a cross platform library built as framework for OSX and iOS, and the version tag is what it is to cover all platforms.

                  Yeah, I thought you might be heading in that direction.  What’s your deployment target for this framework?  These days most macOS products (and all products on iOS-based platforms) are self contained.  As such, there’s no point have multiple versions of the code nested within your framework, because the framework is embedded within an app that contains all of its client code.

                  Moreover doing this is actively harmful:

                  • It makes the framework bigger than necessary.

                  • It puts you well off the beaten path, as you’ve discovered here.

                  Regardless, if you want to keep going down with path you should check out the --bundle-version option to codesign.

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"

                    • Re: copy on code sign, where does version come from?
                      StarGazerI Level 1 Level 1 (0 points)

                      Your last post is totally unhelpful.

                      I don't need to reduce the library file size.  I just need to get this version of the framework to include properly in my application.  Using 1.10.0 instead of A or B doesn't increase size appreciably.  There has to be a way to pick B, unless Apple has just dropped all support for framework compatiblity.  And if that is the case, how is it handled when an App uses frameworks F1(Ver B) and F2(Ver A), where framework F2 uses F1(Ver A)?

                       

                       

                      The current target is an OSX application, which is trying to embed the osx framework of the library.

                      The frameworks also have an iOS flavor, and I have an iOS version of the application in work too.  I'm expecting to use this information for that as well.

                       

                       

                      I said that the library doesn't use A as the framework version identifier.  And that the project option sign on copy does not work when trying to embed the library that is produced.

                      If the libraries were to update incompatibly, should it keep using a framework version A because it's going to be an embedded framework?

                       

                       

                      When the library generates it's output, it creates what looks to be a perfectly valid framework comprising of exactly one version of that framework.

                       

                      XYZ.framework/Versions/1.10.0/....

                      XYZ.framework/Versions/Current -> 1.10.0

                      XYZ.framework/Headers -> Versions/1.10.0/Headers

                      XYZ.framework/Resources-> Versions/1.10.0/Resources

                      XYZ.framework/XYZ-> Versions/1.10.0/XYZ

                       

                       

                      There is more than just one framework

                      No other versions included in the framework folders besides the 1.10.0 for these.  So, I am not trying to pick an old version of the framework while having later versions available.  It's the only version.

                       

                       

                      For the area in the project, it is an embedded framework with a checkmark to sign on copy.

                      There is no place to add a bundle version.  That's what I want to know how to do.

                       

                       

                      Including these frameworks in another project, the sign on copy fails with directory not found .../Versions/A.

                      Of course not, there isn't a Versions/A.  Where does Versions/A come from?  What do I fix in the library or the inclusion of the framework so xcode knows the version is 1.10.0?

                       

                      If it has to always be A, how do you support breaking API changes in a framework that might get embedded?

                      • Re: copy on code sign, where does version come from?
                        StarGazerI Level 1 Level 1 (0 points)

                        To be clear.


                        I didn't write the frameworks.  I am trying to incorporate frameworks that are available in source form.  I am willing to fix either the framework or my inclusion so it includes properly.   The version number identifier was selected by those that provide the framework.  I am just trying to make it work.

                         

                        The frameworks pass all codesign verifications.  The only problem is that xcode tries to sign the wrong location when sign on copy is checked.  That is what I am trying to fix.