明壁幕府忍法帳 > Aptana Index > Home > Titanium SDK > Titanium SDK How-tos > Extending Titanium Mobile > iOS Module Development Guide > iOS Module 64-bit Support

2015.02.24 Ver.12 (2018.5.15)

iOS Module 64-bit Support

Overview

Starting February 1, 2015, Apple will require that all new App Store submissions be compiled using the iOS 8 SDK, and support 64-bit architectures, and starting June 1, 2015, all updated applications will also need to follow the same requirements.

Any module included with your project must support 64-bit architectures.

Module Builds

To update an existing iOS module and make it 64-bit compatible follow these steps:

  1. Open the module's Xcode project.
  2. Accept recommended updates (via the ! symbol in the window title)
  3. Update each of the TARGET (not project) architectures to standard aka $(ARCHS_STANDARD). This can be done by selecting Architectures and hitting the delete key on the keyboard.
  4. Set the iOS Deployment Target to iOS 6.0 or newer.

That's it. Build the module normally with this Release and it should now be 64-bit compatible. To verify, run the following command: 

cd /PATH/TO/MODULE/
xcrun lipo -info build/lib.<MODULE_NAME>.a

And the output should be: 

Architectures in the fat file: build/lib.your_module_here.a are: armv7 i386 x86_64 arm64

Add the architectures field to the manifest file with the architectures to support. To find out which architectures the SDK supports, create a module using this Release and open its manifest file(s). Copy the architectures field from the manifest file to the manifest file of the module you want to build. Android and iOS support difference architectures. Once the architectures field is added, build the module.

Note: 

Icon

Starting with Release 4.0.0, the build will fail if the architectures field is missing or the architectures do not match the architectures the Titanium SDK supports.

For example, add the following lines to the respected manifest files:

ios/manifest:
architectures: armv7 arm64 i386 x86_64

Troubleshooting

Couldn't find module: X for architecture: X

If you see the following error:

Error Log
[ERROR] Script Error Couldn't find module: ti.barcode for architecture: arm64

This could happen if:

  • The module being required is not included in the tiapp.xml.
  • The module being required does not have the architecture the app is running on (arm64 in this case).
Solution(s):
  • The module needs to be rebuilt with 64-bit support. See the instructions above.

Undefined symbols for architecture

See some log examples below.

Error Log

This may happen if your module depends on a 3rd party library that does not include the x86_64 bit architecture.

Solution(s):
  • Rebuild the module with a new build of the library that includes the missing architecture (x86_64 in this case).

 

Error Log

This log shows a number of linker errors referencing the "std" namespace. This happens because the library used by the module needs the "std" standard library. As of 3.5.0.GA Titanium uses the "libc++ (LLVM standard library)" so we now need to specify when to link with the libstdc++ library.

Solution(s):
  • In the module.xcconfig, tell the compiler to link against the libstdc++ library by adding the following line as you would when including a framework.

    module.xcconfig
    OTHER_LDFLAGS=$(inherited) -lstdc++.6.0.9

Module building for armv7, i386, and arm64 but not x86_64

 If you have already followed the instructions above to update the module to 64-bit and it builds 3 of the desired architectures but not x86_64, you may need to update the build.py in the module project.

Solution(s):

Here are two different ways to update the build.py:

  • Edit the existing build.py
    1. Open the build.py in a text editor
    2. Search for "-arch i386" if you find it, remove that text so that the line looks something like this

      build.py
      rc = os.system("xcodebuild -sdk iphonesimulator -configuration Release")
    3. Rebuild your module, and see if it includes x86_64 using xcrun lipo --info as mentioned above.
  • Update the build.py
    1. Create a new module using the same moduleid as the module you are updating
    2. Copy the new build.py it into your old module (overwriting the old build.py)
    3. Rebuild your module, and see if it includes x86_64 using xcrun lipo --info as mentioned above.

 

 

  • ラベルなし