Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Mac deployment (clang) : @BUNDLEIDENTIFIER@ in Info.plist replaced with com.yourcompany

Mac deployment (clang) : @BUNDLEIDENTIFIER@ in Info.plist replaced with com.yourcompany

Scheduled Pinned Locked Moved Installation and Deployment
16 Posts 3 Posters 9.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kniebou
    wrote on last edited by
    #1

    Hi,

    I am developing on MacOSX 10.8 with Clang x86 64bit, with Qt 5.2.1 (and 5.2.0 before that).

    Here is my problem : in my .app, in Info.plist, the key CFBundleIdentifier equals com.yourcompany.MyApp. It is a problem because I want to deploy my application, and I want to replace com.yourcompany by my own value.

    I have looked for a solution, and I found that normally, this value is set by setting QMAKE_TARGET_BUNDLE_PREFIX in the .pro ( https://bugreports.qt-project.org/browse/QTBUG-19006 ).
    Unfortunately, after looking into Qt's code, I realized that this solution was only available when compiling with pbuilder : when using Clang, "@BUNDLEIDENTIFIER@" is replaced automatically with com.yourcompany, and the value of QMAKE_TARGET_BUNDLE_PREFIX is not read.

    Qt/5.2.1/Src/qtbase/qmake/generators/mac/pbuilder_pbx.cpp :

    @
    QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
    if (bundlePrefix.isEmpty())
    bundlePrefix = "com.yourcompany";
    plist_in_text = plist_in_text.replace("@BUNDLEIDENTIFIER@", bundlePrefix + "." + QLatin1String("${PRODUCT_NAME:rfc1034identifier}"));
    @

    Qt/5.2.1/Src/qtbase/qmake/generators/unix/unixmake2.cpp :

    @
    QString bundleIdentifier = "com.yourcompany." + var("QMAKE_BUNDLE");
    if (bundleIdentifier.endsWith(".app"))
    bundleIdentifier.chop(4);
    t << "@$(DEL_FILE) " << info_plist_out << "\n\t"
    << "@sed ";
    foreach (const ProString &arg, commonSedArgs)
    t << arg;
    t << "-e "s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g" "
    << "-e "s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g" "
    @

    For now, the only solutions I found are :

    1. make my own Info.plist, but it would be complicated if it is just to change one key...
    2. replace manually the default value. That is the solution that I chose, because I use a bash script to deploy my application by creating a .pkg file. This way, I just have to do :

    @sed -i '' -e 's/com.yourcompany/com.MyCompany/g' MyApp.app/Contents/Info.plist@

    I could keep going like this, but I came on this forum because I think that it deserved to be mentioned somewhere, and in case someone has a better solution. I didn't report a bug, because I am not sure that it is one : it has already been reported but only fixed for the pbuilder compilation, so maybe there is a reason why it is not done for Clang.

    I hope this will be useful for other people who might have the same problem.

    If you know a better solution, please tell me !

    Thanks ! :)

    Kniebou

    EDIT : with Qt 5.2.0, the CFBundleIdentifier key equals "@BUNDLEIDENTIFIER@", and is not replaced with com.yourcompany anymore. This was fixed in 5.2.1 : now it is replaced with com.yourcompany again.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I can't really comment on why it hasn't been fixed for both however a fix for that is in progress

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kniebou
        wrote on last edited by
        #3

        Hi and thank you for your answer :)

        Is it possible to follow the progress of fixes ? It would be helpful to know when they are available.

        Thanks !

        Kniebou

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          If a bug report has been opened then the bug report itself, and/or the related submissions :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Kniebou
            wrote on last edited by
            #5

            Ok thank you, I will look if I find a bug report about it :)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              There's currently no bug report attached to this one

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • K Offline
                K Offline
                Kniebou
                wrote on last edited by
                #7

                Ok, thanks ! I just posted a comment on the bug report I talked about.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Kniebou
                  wrote on last edited by
                  #8

                  The problem is fixed with Qt 5.3 RC !!

                  Qt/5.3/Src/qtbase/qmake/generators/unix/unixmake2.cpp :

                  @
                  QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
                  if (bundlePrefix.isEmpty())
                  bundlePrefix = "com.yourcompany.";
                  QString bundleIdentifier = bundlePrefix + var("QMAKE_BUNDLE");

                  (...)

                  t << "-e "s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g" "
                  << "-e "s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g" "
                  @

                  The only thing is that you must put a "." at the end of QMAKE_TARGET_BUNDLE_PREFIX, which is not the case with pbuilder...

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    Good catch, a fix for that is under review

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      Kniebou
                      wrote on last edited by
                      #10

                      Fixed in Qt 5.3.1 !

                      "https://qt.gitorious.org/qt/qtbase/source/b1d99dad098320777a4391052eac531c834748fa:dist/changes-5.3.1":https://qt.gitorious.org/qt/qtbase/source/b1d99dad098320777a4391052eac531c834748fa:dist/changes-5.3.1

                      Thanks for everything !! :)

                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        bercik
                        wrote on last edited by
                        #11

                        Hi,
                        i've got custom .plist file in my app...

                        with 5.3.1 i got following error while compiling app for iOS

                        CFBundleIdentifier '@BUNDLEIDENTIFIER@' contains illegal character '@'

                        The same app was compiled with 5.3.0 without any errors. For now i've set CFBundleIdentifier with my company string and it works ok.

                        Cheers

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          How does your plist look like ?

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • B Offline
                            B Offline
                            bercik
                            wrote on last edited by
                            #13

                            It was the default one from /ios/mkspecs/macx-ios-clang/, plus i've added two additional keys at the end

                            @<?xml version="1.0" encoding="UTF-8"?>
                            <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                            <plist version="1.0">
                            <dict>
                            <key>CFBundleIconFile</key>
                            <string>@ICON@</string>
                            <key>CFBundlePackageType</key>
                            <string>APPL</string>
                            <key>CFBundleGetInfoString</key>
                            <string>Created by Qt/QMake</string>
                            <key>CFBundleSignature</key>
                            <string>@TYPEINFO@</string>
                            <key>CFBundleExecutable</key>
                            <string>@EXECUTABLE@</string>
                            <key>CFBundleIdentifier</key>
                            <string>@BUNDLEIDENTIFIER@</string>
                            <key>CFBundleDisplayName</key>
                            <string>${PRODUCT_NAME}</string>
                            <key>CFBundleName</key>
                            <string>${PRODUCT_NAME}</string>
                            <key>CFBundleShortVersionString</key>
                            <string>1.0</string>
                            <key>CFBundleVersion</key>
                            <string>1.0</string>
                            <key>NOTE</key>
                            <string>This file was generated by Qt/QMake.</string>
                            <key>UISupportedInterfaceOrientations</key>
                            <array>
                            <string>UIInterfaceOrientationLandscapeRight</string>
                            </array>
                            <key>UIStatusBarHidden</key>
                            <true/>
                            </dict>
                            </plist>@

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              At what stage do you get that error ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • B Offline
                                B Offline
                                bercik
                                wrote on last edited by
                                #15

                                I've created now new project just for test purposes.
                                The only thing that i've done now was copying default plist file and adding

                                QMAKE_INFO_PLIST = my.plist in .pro file.

                                The error appears at following stage :

                                ProcessProductPackaging /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/Entitlements.plist Err.build/Debug-iphoneos/Err.build/Err.xcent
                                cd /Users/Robert/WORK/development/QT/projects/build-Err-iphoneos_clang_Qt_5_3_1_for_iOS-Debug
                                export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
                                builtin-productPackagingUtility /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/Entitlements.plist -entitlements -format xml -o /Users/Robert/WORK/development/QT/projects/build-Err-iphoneos_clang_Qt_5_3_1_for_iOS-Debug/Err.build/Debug-iphoneos/Err.build/Err.xcent
                                (null): error: CFBundleIdentifier '@BUNDLEIDENTIFIER@' contains illegal character '@'
                                invalid bundle identifier '@BUNDLEIDENTIFIER@'

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  I would say that you where lucky before. AFAIK these are placeholder values meant to be replaced with something sensible or if nothing is given, removed.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved