Apache Cordova
  1. Apache Cordova
  2. CB-260

Can't install Phonegap with new Xcode 4.3

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.6.0
    • Component/s: iOS
    • Labels:
    • Environment:

      OS X 10.7.3 (Lion)

      Description

      I've just updated my Xcode installation on Lion to 4.3, and now I cannot
      install the latest build of Phonegap 1.4.1: the installer says I do not have
      the iOS SDK installed. Xcode 4.3 makes
      significant changes in the layout of the SDK's, etc. on OS X: it's a single
      standalone app that is installed in /Applications. /Developer is no longer
      used. I suspect that this confusing the installer. Most likely a re-architected installer to support the new developer configuration in Xcode 4.3 is required. Obviously this is a showstopper because I cannot develop a PhoneGap application if PhoneGap cannot be installed.

      1. CordovaInstaller.zip
        4 kB
        Stéphane Paquet
      2. Makefile
        11 kB
        Stéphane Paquet
      3. ASF.LICENSE.NOT.GRANTED--screenshot-3.jpg
        27 kB
        Stéphane Paquet
      4. ASF.LICENSE.NOT.GRANTED--screenshot-2.jpg
        28 kB
        Stéphane Paquet
      5. ASF.LICENSE.NOT.GRANTED--screenshot-1.jpg
        48 kB
        Stéphane Paquet

        Activity

        Hide
        Kevin Walzer added a comment -

        Another person notified me on the mailing list that the installer worked for them, and I confirmed it as well.

        Show
        Kevin Walzer added a comment - Another person notified me on the mailing list that the installer worked for them, and I confirmed it as well.
        Hide
        Tommy-Carlos Williams added a comment -

        Although Kevin has closed this, it is still an issue that PhoneGap complains about the missing iOS SDK if you have 4.3 installed and therefore have no "/Developer" directory. I confirmed for him that you could just ignore the warning and install anyway, but it still needs to be addressed.

        Show
        Tommy-Carlos Williams added a comment - Although Kevin has closed this, it is still an issue that PhoneGap complains about the missing iOS SDK if you have 4.3 installed and therefore have no "/Developer" directory. I confirmed for him that you could just ignore the warning and install anyway, but it still needs to be addressed.
        Hide
        Kevin Walzer added a comment -

        Looks like the dialog checking for the existence of the iOS SDK can still trip people up.

        Show
        Kevin Walzer added a comment - Looks like the dialog checking for the existence of the iOS SDK can still trip people up.
        Hide
        Stéphane Paquet added a comment -

        No it's not working for sure.
        There are at least 2 things to be corrected (I tried them). But first, I'd like to highlight that if you still have previous version of Xcode on your machine they are hiding this issue. In order to see it just clean you Mac of any previous version, install Xcode 4.3 and install Command Line Tools and do not forget some other addons (such as PackageMaker) which are no more in the Xcode 4.3 bundle.
        Once this is done you have to correct few things in the Makefile:

        PACKAGEMAKER = '/Applications/Developer Utilities/Auxiliary Tools/PackageMaker.app/Contents/MacOS/PackageMaker'
        Make it points to where your PackageMaker app is now (remember that you now have to set it up by yourself)

        xcode-select : run xcode-select -swith /Applications/Xcode.app/ (as Xcode 4.3 no longer lies in /Developer/...

        Once these things are doen you should be able to compile without any error, but, still you installation is not going to succeed.

        You now have to change few things in CordobaInstalled.
        First, edit CordovaInstaller.pmdoc with PackageManager and in Cordoba distribution go to Requirements and make sure that the respective values for "file path" are:

        1. /Applications/Xcode.app
        2. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform

        Save and go to your parent directory to run the make command. From now you will have a fully working install (I'm still checking for something cleaner, where templates are installing at the right place)

        Show
        Stéphane Paquet added a comment - No it's not working for sure. There are at least 2 things to be corrected (I tried them). But first, I'd like to highlight that if you still have previous version of Xcode on your machine they are hiding this issue. In order to see it just clean you Mac of any previous version, install Xcode 4.3 and install Command Line Tools and do not forget some other addons (such as PackageMaker) which are no more in the Xcode 4.3 bundle. Once this is done you have to correct few things in the Makefile: PACKAGEMAKER = '/Applications/Developer Utilities/Auxiliary Tools/PackageMaker.app/Contents/MacOS/PackageMaker' Make it points to where your PackageMaker app is now (remember that you now have to set it up by yourself) xcode-select : run xcode-select -swith /Applications/Xcode.app/ (as Xcode 4.3 no longer lies in /Developer/... Once these things are doen you should be able to compile without any error, but, still you installation is not going to succeed. You now have to change few things in CordobaInstalled. First, edit CordovaInstaller.pmdoc with PackageManager and in Cordoba distribution go to Requirements and make sure that the respective values for "file path" are: 1. /Applications/Xcode.app 2. /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform Save and go to your parent directory to run the make command. From now you will have a fully working install (I'm still checking for something cleaner, where templates are installing at the right place)
        Hide
        Stéphane Paquet added a comment -

        Cordobainstalled.pmdoc modification (to support XCode 4.3)

        Show
        Stéphane Paquet added a comment - Cordobainstalled.pmdoc modification (to support XCode 4.3)
        Hide
        Stéphane Paquet added a comment -

        File path change to match new "home" folder for Xcode 4.3

        Show
        Stéphane Paquet added a comment - File path change to match new "home" folder for Xcode 4.3
        Hide
        Stéphane Paquet added a comment -

        File path change to point at new iOS location when using XCode 4.3

        Show
        Stéphane Paquet added a comment - File path change to point at new iOS location when using XCode 4.3
        Hide
        Stéphane Paquet added a comment -

        Here is a patched Makefile, which is able to find PackageMaker wherever it could be (to be confirmed)

        Show
        Stéphane Paquet added a comment - Here is a patched Makefile, which is able to find PackageMaker wherever it could be (to be confirmed)
        Hide
        Stéphane Paquet added a comment -

        Here is patched version of CordovaInstalled.pmdoc

        Show
        Stéphane Paquet added a comment - Here is patched version of CordovaInstalled.pmdoc
        Hide
        Shazron Abdullah added a comment -

        Thanks Stéphane,

        Looks like this issue is two issues:
        1. Xcode optional requirement is incorrect now (and may trip up users) because of Xcode 4.3's location in /Applications
        2. PackageMaker location in the Makefile - devs will not be able to create a .pkg since the location is different if they only have Xcode 4.3

        Issue #1 - side-effect is if we edit the .pmdoc with your changes then someone using Xcode 4.2 will now get the warning

        Issue #2 can be patched according to your changes with no side effects

        So I propose these fixes:
        1. Fix issue #1 by removing the Xcode requirement completely
        2. Fix issue #2 by patching it with your changes

        Show
        Shazron Abdullah added a comment - Thanks Stéphane, Looks like this issue is two issues: 1. Xcode optional requirement is incorrect now (and may trip up users) because of Xcode 4.3's location in /Applications 2. PackageMaker location in the Makefile - devs will not be able to create a .pkg since the location is different if they only have Xcode 4.3 Issue #1 - side-effect is if we edit the .pmdoc with your changes then someone using Xcode 4.2 will now get the warning Issue #2 can be patched according to your changes with no side effects So I propose these fixes: 1. Fix issue #1 by removing the Xcode requirement completely 2. Fix issue #2 by patching it with your changes
        Hide
        Stéphane Paquet added a comment -

        Hi,

        Yes, actually if you look at the Makefile you'll see that the path to PackageMaker is dynamic in order to take into account the fact that PackageMaker could now be located anywhere.

        I also did not mentioned that point, but quite important in to solve this case too, Command Line Tool has to be added either via Xcode > Preferences > Download.

        There is one point I still have not investigated: template location, which might have been changed too.

        Bests

        Stéphane

        Show
        Stéphane Paquet added a comment - Hi, Yes, actually if you look at the Makefile you'll see that the path to PackageMaker is dynamic in order to take into account the fact that PackageMaker could now be located anywhere. I also did not mentioned that point, but quite important in to solve this case too, Command Line Tool has to be added either via Xcode > Preferences > Download. There is one point I still have not investigated: template location, which might have been changed too. Bests Stéphane
        Hide
        Shazron Abdullah added a comment -

        Since Command Line Tools to be installed is a requirement - issue #2 fix will need to be pushed to 1.6.0 so we can properly test, document, etc. Besides, Xcode 4.3 is not out for general availability yet.

        Issue #1 fix can be slated for 1.5.0 since this is the typical interaction for users even for Xcode 4.3, and most won't need to compile the .pkg from a Makefile.

        This issue will remain open until the #2 fix has been implemented in 1.6.0

        Show
        Shazron Abdullah added a comment - Since Command Line Tools to be installed is a requirement - issue #2 fix will need to be pushed to 1.6.0 so we can properly test, document, etc. Besides, Xcode 4.3 is not out for general availability yet. Issue #1 fix can be slated for 1.5.0 since this is the typical interaction for users even for Xcode 4.3, and most won't need to compile the .pkg from a Makefile. This issue will remain open until the #2 fix has been implemented in 1.6.0
        Show
        Shazron Abdullah added a comment - More info: https://groups.google.com/forum/?fromgroups#!topic/macenterprise/v4qRFnCutS4
        Hide
        Kevin Walzer added a comment -

        Xcode 4.3 is out for general availability...it was released this week.

        Show
        Kevin Walzer added a comment - Xcode 4.3 is out for general availability...it was released this week.
        Hide
        Filip Maj added a comment -

        This one bit me too.

        On a fresh Lion machine (Macbook Air), installed Xcode from the App Store, then building from src was an issue.

        First had an error where the folder to Xcode was not set, and so got an error about using xcode-select. I ended up setting it to /Applications/Xcode.app/Contents/Developer.
        Then had to download the Auxiliary Tools to get Package Maker: https://developer.apple.com/downloads/index.action?name=auxiliary - it was not obvious that this was necessary.
        Then had to tweak the Makefile and edit the location of the Package Maker variable.

        Now it works

        Show
        Filip Maj added a comment - This one bit me too. On a fresh Lion machine (Macbook Air), installed Xcode from the App Store, then building from src was an issue. First had an error where the folder to Xcode was not set, and so got an error about using xcode-select. I ended up setting it to /Applications/Xcode.app/Contents/Developer. Then had to download the Auxiliary Tools to get Package Maker: https://developer.apple.com/downloads/index.action?name=auxiliary - it was not obvious that this was necessary. Then had to tweak the Makefile and edit the location of the Package Maker variable. Now it works
        Hide
        Stéphane Paquet added a comment -

        PACKAGEMAKER = $(mdfind "kMDItemDisplayName=='PackageMaker' && kMDItemKind=='Application'")
        Still not in 1.5.0rc1 makefile
        This should be set as it is working for Xcode < 4.3 and for 4.3

        Show
        Stéphane Paquet added a comment - PACKAGEMAKER = $(mdfind "kMDItemDisplayName=='PackageMaker' && kMDItemKind=='Application'") Still not in 1.5.0rc1 makefile This should be set as it is working for Xcode < 4.3 and for 4.3
        Hide
        Stéphane Paquet added a comment -

        Oups the above is not working, I forgot couple of things. Here is a correct version: PACKAGEMAKER = '$(shell mdfind "kMDItemDisplayName=='PackageMaker' && kMDItemKind=='Application'")/Contents/MacOS/PackageMaker'

        Show
        Stéphane Paquet added a comment - Oups the above is not working, I forgot couple of things. Here is a correct version: PACKAGEMAKER = '$(shell mdfind "kMDItemDisplayName=='PackageMaker' && kMDItemKind=='Application'")/Contents/MacOS/PackageMaker'
        Hide
        Shazron Abdullah added a comment -

        Yikes - such a pain I'm going to modify the Makefile (with the recommended fixes) assume that the user is using Xcode 4.3, with a separate target if devs are using the old Xcode, and document as such.

        Show
        Shazron Abdullah added a comment - Yikes - such a pain I'm going to modify the Makefile (with the recommended fixes) assume that the user is using Xcode 4.3, with a separate target if devs are using the old Xcode, and document as such.
        Hide
        Stéphane Paquet added a comment -

        The last suggested packagemaker path should work for both version of XCode.

        Envoyé de mon iPad

        Show
        Stéphane Paquet added a comment - The last suggested packagemaker path should work for both version of XCode. Envoyé de mon iPad
        Hide
        Shazron Abdullah added a comment - - edited

        Hmm, when I do on the command line:

        mdfind "kMDItemDisplayName=='PackageMaker' && kMDItemKind=='Application'"
        

        ... it can't find PackageMaker.

        But if I do:

        mdfind "kMDItemDisplayName=='PackageMaker.app' && kMDItemKind=='Application'"
        

        ... it finds it.

        I confirmed PackageMaker's display name is "PackageMaker.app" when searching through Spotlight as well. I downloaded PackageMaker from https://developer.apple.com/downloads/index.action?name=auxiliary and put in /Applications.

        Can you confirm by doing the same?

        Show
        Shazron Abdullah added a comment - - edited Hmm, when I do on the command line: mdfind "kMDItemDisplayName=='PackageMaker' && kMDItemKind=='Application'" ... it can't find PackageMaker. But if I do: mdfind "kMDItemDisplayName=='PackageMaker.app' && kMDItemKind=='Application'" ... it finds it. I confirmed PackageMaker's display name is "PackageMaker.app" when searching through Spotlight as well. I downloaded PackageMaker from https://developer.apple.com/downloads/index.action?name=auxiliary and put in /Applications. Can you confirm by doing the same?
        Hide
        Shazron Abdullah added a comment -

        I worked-around it by using "PackageMaker*"

        Show
        Shazron Abdullah added a comment - I worked-around it by using "PackageMaker*"
        Hide
        Shazron Abdullah added a comment -
        Show
        Shazron Abdullah added a comment - Sent pull-request: https://github.com/apache/incubator-cordova-ios/pull/6
        Hide
        Stéphane Paquet added a comment -

        mdfind "kMDItemDisplayName=='PackageMaker*' && kMDItemKind=='Application'" is working fine and is the best option as I have the opposite behavior on my mac (regarding your previous point).

        Adding the * makes it work on every platform.

        for your information my configuration is :OS X 10.7.3 XCode 4.3

        Show
        Stéphane Paquet added a comment - mdfind "kMDItemDisplayName=='PackageMaker*' && kMDItemKind=='Application'" is working fine and is the best option as I have the opposite behavior on my mac (regarding your previous point). Adding the * makes it work on every platform. for your information my configuration is :OS X 10.7.3 XCode 4.3
        Hide
        Shazron Abdullah added a comment -

        Makefile updated to support new Xcode 4.3 location (and should be backwards compatible with 4.2 etc)

        Show
        Shazron Abdullah added a comment - Makefile updated to support new Xcode 4.3 location (and should be backwards compatible with 4.2 etc)
        Hide
        lmnbeyond added a comment -

        Many thanks for Shazron Abdullah , Stéphane Paquet and Tommy-Carlos Williams.
        I'm a newbie to ios development. And My mother Language is not English, so if I wrote something wrong, please forgive me

        I downloaded the updated makefile, but it's still not work for me!

        My configuration is: os x 10.7.3 Xcode 4.3.1

        I compiled the source code, it reported: "Xcode.app was not found. Please download from the Mac App Store." But I'm pretty sure I have installed xcode in my mac air.

        xcode-select -print-path
        The output is:/Applications/Xcode.app/Contents/Developer

        So I followed Stéphane Paquet's comments, modified XC_AVAILABLE and PM_APP, make them point to where my Xcode.app and PackageMaker.app is. After that, the source code is compiled sucessfully.

        I hope my experience can help you!

        Show
        lmnbeyond added a comment - Many thanks for Shazron Abdullah , Stéphane Paquet and Tommy-Carlos Williams. I'm a newbie to ios development. And My mother Language is not English, so if I wrote something wrong, please forgive me I downloaded the updated makefile, but it's still not work for me! My configuration is: os x 10.7.3 Xcode 4.3.1 I compiled the source code, it reported: "Xcode.app was not found. Please download from the Mac App Store." But I'm pretty sure I have installed xcode in my mac air. xcode-select -print-path The output is:/Applications/Xcode.app/Contents/Developer So I followed Stéphane Paquet's comments, modified XC_AVAILABLE and PM_APP, make them point to where my Xcode.app and PackageMaker.app is. After that, the source code is compiled sucessfully. I hope my experience can help you!
        Hide
        Stéphane Paquet added a comment -

        The one in this thread is not working... I patched it, but not in the thread.
        The correct one is now in the downloadable version of Cordoba (previously PhoneGap).

        Hope this helps you

        Show
        Stéphane Paquet added a comment - The one in this thread is not working... I patched it, but not in the thread. The correct one is now in the downloadable version of Cordoba (previously PhoneGap). Hope this helps you
        Hide
        George Wu added a comment -

        If I want to stick with phonegap 1.4.1 and working in xcode 4.3.3 , any suggestion on how to make it work?

        THANKS,

        George

        Show
        George Wu added a comment - If I want to stick with phonegap 1.4.1 and working in xcode 4.3.3 , any suggestion on how to make it work? THANKS, George

          People

          • Assignee:
            Shazron Abdullah
            Reporter:
            Kevin Walzer
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development