Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.5.0
    • Component/s: CordovaJS, iOS
    • Labels:
      None
    • Environment:

      OSX

      Description

      In project settings, developers are now required to add arm64 under valid Architectures build settings. If we do not want to support arm64 or are unable to (because of other SDK dependency), our app will no longer work and get the following compile errors:

      undefined symbols for architecture armv7:
      "OBJC_CLASS$_CDVPlugin", referenced from:
      OBJC_CLASS$_OpenTokPlugin in OpenTokPlugin.o
      "OBJC_METACLASS$_CDVPlugin", referenced from:
      OBJC_METACLASS$_OpenTokPlugin in OpenTokPlugin.o
      ...

      To reproduce:
      1. Create new project (Cordova create YourApp)
      2. Add ios platform ( Cordova plaform add ios )
      3. Open xcode ( open YourApp/platform/ios/...xcodeproj )
      4. Change project build settings ( Valid Architectures to only armv7 - remove armv7s and arm64 )
      5. Change project build settings (Build Active Architecture Only - No )

      Result:
      undefined symbol errors during compile time.

      This was a breaking change from Cordova v 3.4.0-0.1.3

        Activity

        Hide
        Shazron Abdullah added a comment -

        This was fixed in the release of 3.4.1. Update your cordova tool

        Show
        Shazron Abdullah added a comment - This was fixed in the release of 3.4.1. Update your cordova tool
        Hide
        Song Zheng added a comment -

        Are you sure? I had to downgrade from 3.4.1 to 3.4.0 because of this bug. This bug is newly introduced in 3.4.1

        Show
        Song Zheng added a comment - Are you sure? I had to downgrade from 3.4.1 to 3.4.0 because of this bug. This bug is newly introduced in 3.4.1
        Hide
        Shazron Abdullah added a comment -

        Apologies, I misread your actual issue. Yes, this is not a bug, Cordova is going 64-bit by default. For those exceptions like yours, users can edit the Build Settings.

        Show
        Shazron Abdullah added a comment - Apologies, I misread your actual issue. Yes, this is not a bug, Cordova is going 64-bit by default. For those exceptions like yours, users can edit the Build Settings.
        Hide
        Song Zheng added a comment -

        What settings could I change to avoid this error? If I remove arm64 Cordova no longer builds. If I leave arm64 (by default) my SDKs no longer builds. Should I stay with 3.4.0 until all my SDK dependencies support arm64 as well?

        Show
        Song Zheng added a comment - What settings could I change to avoid this error? If I remove arm64 Cordova no longer builds. If I leave arm64 (by default) my SDKs no longer builds. Should I stay with 3.4.0 until all my SDK dependencies support arm64 as well?
        Hide
        Shazron Abdullah added a comment -

        The 64 bit binary includes a 32 bit slice, so it runs on all devices. However due to this, during link time all code must have a 64-bit slice, which includes your libraries of course (contact your vendor for an update).

        Show
        Shazron Abdullah added a comment - The 64 bit binary includes a 32 bit slice, so it runs on all devices. However due to this, during link time all code must have a 64-bit slice, which includes your libraries of course (contact your vendor for an update).
        Hide
        Song Zheng added a comment -

        Taking vendors out of the picture, I still cannot compile a freshly created app onto my iOS device (7.1.1).
        Seems that arm64 is now a required flag for "Valid Architectures" under build settings in Cordova 3.1.4. Is this expected behavior?

        Show
        Song Zheng added a comment - Taking vendors out of the picture, I still cannot compile a freshly created app onto my iOS device (7.1.1). Seems that arm64 is now a required flag for "Valid Architectures" under build settings in Cordova 3.1.4. Is this expected behavior?
        Hide
        Shazron Abdullah added a comment -

        That is strange. We've been testing with 3.4.1 everyday, no one has that issue so far (unable to compile and deploy to device). I just created a new project on 3.4.1 and deployed on a 32-bit device, to be sure.

        Show
        Shazron Abdullah added a comment - That is strange. We've been testing with 3.4.1 everyday, no one has that issue so far (unable to compile and deploy to device). I just created a new project on 3.4.1 and deployed on a 32-bit device, to be sure.
        Hide
        Song Zheng added a comment -

        Sorry, I might have been unclear. If you create a new project, remove arm64 and armv7s from the project's "Valid architecture" under build settings, you will get errors if you try to deploy to device (tested on iPhone 5s). Is this expected behavior?

        Show
        Song Zheng added a comment - Sorry, I might have been unclear. If you create a new project, remove arm64 and armv7s from the project's "Valid architecture" under build settings, you will get errors if you try to deploy to device (tested on iPhone 5s). Is this expected behavior?
        Hide
        Shazron Abdullah added a comment -

        I see what you mean now.

        The fix is to:
        1. Modify the Build Settings for CordovaLib.xcodeproj to use $ARCHS_STANDARD (armv7, armv7s, arm64) only (remove the other sub-settings in both Project and Target).

        This is also required if you want to build for a specific architecture and not the current one:
        1. Modify your project settings "Build Active Architecture" to No.

        Show
        Shazron Abdullah added a comment - I see what you mean now. The fix is to: 1. Modify the Build Settings for CordovaLib.xcodeproj to use $ARCHS_STANDARD (armv7, armv7s, arm64) only (remove the other sub-settings in both Project and Target). This is also required if you want to build for a specific architecture and not the current one: 1. Modify your project settings "Build Active Architecture" to No.
        Hide
        Song Zheng added a comment -

        Awesome. Thank you for catching this Shazron Abdullah

        Show
        Song Zheng added a comment - Awesome. Thank you for catching this Shazron Abdullah
        Hide
        ASF subversion and git services added a comment -

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

        CB-6500 - Cordova requires arm64 architecture.

        Removes the conditional arches in CordovaLib, and removes VALID_ARCHS (relies on default).

        Show
        ASF subversion and git services added a comment - Commit ae075907595e6d11a421df74f0f3cbdcd34627d8 in cordova-ios's branch refs/heads/master from Shazron Abdullah [ https://git-wip-us.apache.org/repos/asf?p=cordova-ios.git;h=ae07590 ] CB-6500 - Cordova requires arm64 architecture. Removes the conditional arches in CordovaLib, and removes VALID_ARCHS (relies on default).

          People

          • Assignee:
            Shazron Abdullah
            Reporter:
            Song Zheng
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development