Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-28304] iOS: Enabling swift in Objc based module is failing while building

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2021-02-02T15:24:41.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.3.2, Release 10.0.0
ComponentsiOS
Labelsmodule_build, swift
ReporterVijay Singh
AssigneeVijay Singh
Created2020-12-23T23:09:23.000+0000
Updated2021-02-02T15:25:01.000+0000

Description

In Objc based module if we add swift file and build, it is failing with error -
error: using bridging headers with module interfaces is unsupported.
The reason is that we are using [BUILD_LIBRARY_FOR_DISTRIBUTION=YES](https://github.com/appcelerator/titanium_mobile/blob/c3de1e1b9029f6cc9bed9162dde27ff5058c6835/iphone/cli/commands/_buildModule.js#L575) for building module. Ideally it should be used when we build for framework. For static libraries it should be default. Some details can be found [here](https://handyopinion.com/xcode-error-using-bridging-headers-with-module-interfaces-is-unsupported/) and [here](https://swift.org/blog/library-evolution/) .

Comments

  1. Vijay Singh 2021-01-06

    PR - https://github.com/appcelerator/titanium_mobile/pull/12372 How to test - 1. Create a Objc based module or use the existing Objc based module e.g. ti.nfc 2. Open ti.nfc.xcodeproj in Xcode. 3. Add a swift file in the project. 4. On showing alert 'Would you like to configure an Objective-C bridging header?', select 'Create Bridging Header' button. 5. Now build the module using CLI. It should build the module without error.
  2. Christopher Williams 2021-02-02

    merged to master for 10.0.0 target. Backport PR for 9_3_X is in progress (for potential 9.3.2 release)
  3. Christopher Williams 2021-02-02

    merged to 9_3_X for potential 9.3.2

JSON Source