Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12673

ios platform does not build on Xcode 8.3.2

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: cordova-ios@4.4.0
    • Component/s: cordova-ios
    • Labels:
      None
    • Environment:

      iOS

      Description

      Build error Cordova/CDVViewController.h file not found

      Turns out the CordovaLib.xcodeproj reference in the template's project is not found.

      Fix in the .pbxproj:
      Change

      { isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = "CordovaLib.xcodeproj"; sourceTree = CORDOVALIB; };
      

      to

      { isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
      

      Note that I have not tested this change with an older Xcode 8 (< 8.3.2), so that might complicate things.

      iOS platforms in the wild older than cordova-ios@4.4.0 will need a hook to transform the pbxproj if the developer upgraded to Xcode 8.3.2

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user shazron commented on the issue:

          https://github.com/apache/cordova-ios/pull/307

          @qcgm1978 not sure why you commented here, it's not relevant to the issue. Cordova was meant to be used through the CLI, not Xcode. `www` is for edits when using the cordova cli, it will process and copy to the respective platforms folders. Since you are in Xcode dev mode only, you modify the `Staging\www` contents.

          Show
          githubbot ASF GitHub Bot added a comment - Github user shazron commented on the issue: https://github.com/apache/cordova-ios/pull/307 @qcgm1978 not sure why you commented here, it's not relevant to the issue. Cordova was meant to be used through the CLI, not Xcode. `www` is for edits when using the cordova cli, it will process and copy to the respective platforms folders. Since you are in Xcode dev mode only, you modify the `Staging\www` contents.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user qcgm1978 commented on the issue:

          https://github.com/apache/cordova-ios/pull/307

          @shazron I create a new project and open it in Xcode, when I modified js file in www folder, it not update after click run button to execute it in emulator.

          Show
          githubbot ASF GitHub Bot added a comment - Github user qcgm1978 commented on the issue: https://github.com/apache/cordova-ios/pull/307 @shazron I create a new project and open it in Xcode, when I modified js file in www folder, it not update after click run button to execute it in emulator.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user shazron commented on the issue:

          https://github.com/apache/cordova-ios/pull/307

          @leshik can you try with a new fresh project? perhaps in a new existing project you need to `cordova platform rm ios` then `cordova platform add ios`
          Confirm you are getting the latest: `cordova platform ls`

          Show
          githubbot ASF GitHub Bot added a comment - Github user shazron commented on the issue: https://github.com/apache/cordova-ios/pull/307 @leshik can you try with a new fresh project? perhaps in a new existing project you need to `cordova platform rm ios` then `cordova platform add ios` Confirm you are getting the latest: `cordova platform ls`
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user leshik commented on the issue:

          https://github.com/apache/cordova-ios/pull/307

          @shazron hi, doesn't work for me with latest cordova-ios@4.4.0 – same error (`<Cordova/CDVViewController.h> file not found`).
          What can I do to troubleshoot the issue?

          Show
          githubbot ASF GitHub Bot added a comment - Github user leshik commented on the issue: https://github.com/apache/cordova-ios/pull/307 @shazron hi, doesn't work for me with latest cordova-ios@4.4.0 – same error (`<Cordova/CDVViewController.h> file not found`). What can I do to troubleshoot the issue?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/cordova-ios/pull/307

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/cordova-ios/pull/307
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 39160bde6fb4a951f94c6eb525c2a44e4f09102e in cordova-ios's branch refs/heads/master from Shazron Abdullah
          [ https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git;h=39160bd ]

          CB-12673 - ios platform does not build on Xcode 8.3.2

          This closes #307

          Show
          jira-bot ASF subversion and git services added a comment - Commit 39160bde6fb4a951f94c6eb525c2a44e4f09102e in cordova-ios's branch refs/heads/master from Shazron Abdullah [ https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git;h=39160bd ] CB-12673 - ios platform does not build on Xcode 8.3.2 This closes #307
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user shazron commented on the issue:

          https://github.com/apache/cordova-ios/pull/307

          Not sure why CI is failing on an unrelated unit-test, it passes locally. Investigating.

          Show
          githubbot ASF GitHub Bot added a comment - Github user shazron commented on the issue: https://github.com/apache/cordova-ios/pull/307 Not sure why CI is failing on an unrelated unit-test, it passes locally. Investigating.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user shazron opened a pull request:

          https://github.com/apache/cordova-ios/pull/307

          CB-12673 - ios platform does not build on Xcode 8.3.2

              1. Platforms affected

          self

              1. What does this PR do?

          Fixes the CordovaLib.xcodeproj reference in the template. Xcode 8.3.2 will not build a cordova-ios platform with the old reference.

              1. What testing has been done on this change?

          1. Installed Xcode 8.3.2
          2. Created a new Cordova project
          3. Added a cordova-ios platform (4.3.1) locally from disk using a file path
          4. cordova build --emulator

              1. Checklist
          • [X] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA database
          • [X] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/shazron/cordova-ios CB-12673

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/cordova-ios/pull/307.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #307


          commit 679d87ee10f440162923615fc178bd06be20c43b
          Author: Shazron Abdullah <shazron@gmail.com>
          Date: 2017-04-19T21:41:23Z

          CB-12673 - ios platform does not build on Xcode 8.3.2


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user shazron opened a pull request: https://github.com/apache/cordova-ios/pull/307 CB-12673 - ios platform does not build on Xcode 8.3.2 Platforms affected self What does this PR do? Fixes the CordovaLib.xcodeproj reference in the template. Xcode 8.3.2 will not build a cordova-ios platform with the old reference. What testing has been done on this change? 1. Installed Xcode 8.3.2 2. Created a new Cordova project 3. Added a cordova-ios platform (4.3.1) locally from disk using a file path 4. cordova build --emulator Checklist [X] [Reported an issue] ( http://cordova.apache.org/contribute/issues.html ) in the JIRA database [X] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected. You can merge this pull request into a Git repository by running: $ git pull https://github.com/shazron/cordova-ios CB-12673 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-ios/pull/307.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #307 commit 679d87ee10f440162923615fc178bd06be20c43b Author: Shazron Abdullah <shazron@gmail.com> Date: 2017-04-19T21:41:23Z CB-12673 - ios platform does not build on Xcode 8.3.2
          Hide
          shazron Shazron Abdullah added a comment - - edited

          Looks like its not Xcode, since when I just do a cordova platform add ios it does that transformation, not sure why – I attribute it to caching shenanigans. I tried adding the platform locally and it fails (no transformation).

          Show
          shazron Shazron Abdullah added a comment - - edited Looks like its not Xcode, since when I just do a cordova platform add ios it does that transformation, not sure why – I attribute it to caching shenanigans. I tried adding the platform locally and it fails (no transformation).
          Hide
          shazron Shazron Abdullah added a comment -

          Interesting. Sometimes when I do a build it changes:

          { isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = "CordovaLib.xcodeproj"; sourceTree = CORDOVALIB; };
          

          to:

          { isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; };
          

          ... but sometimes it doesn't. When it changes it, it builds fine. When it doesn't, it results in my build error. So Xcode does offer a backwards compatible change (it transforms it for you), but it is not reliable.

          Tested by creating a new project, adding the ios platform, then observing the .pbxproj before and after a build.

          Show
          shazron Shazron Abdullah added a comment - Interesting. Sometimes when I do a build it changes: { isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project" ; path = "CordovaLib.xcodeproj" ; sourceTree = CORDOVALIB; }; to: { isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project" ; name = CordovaLib.xcodeproj; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>" ; }; ... but sometimes it doesn't. When it changes it, it builds fine. When it doesn't, it results in my build error. So Xcode does offer a backwards compatible change (it transforms it for you), but it is not reliable. Tested by creating a new project, adding the ios platform, then observing the .pbxproj before and after a build.
          Hide
          shazron Shazron Abdullah added a comment -

          Happy to report that the proposed fix builds on Xcode 8.3.1 as well.

          Show
          shazron Shazron Abdullah added a comment - Happy to report that the proposed fix builds on Xcode 8.3.1 as well.

            People

            • Assignee:
              shazron Shazron Abdullah
              Reporter:
              shazron Shazron Abdullah
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development