Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23808] Hyperloop: iOS - Example application not building with Xcode 8 because of Swift-Error

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-10-07T14:23:00.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0, Hyperloop 2.0.0, hyperloop 1.2.8
ComponentsHyperloop, iOS, Tooling
Labelsqe-5.5.0
ReporterJosh Longton
AssigneeJan Vennemann
Created2016-08-23T20:23:45.000+0000
Updated2018-08-06T17:49:37.000+0000

Description

Steps to reproduce:

Download the hyperloop sample application from [here](https://github.com/appcelerator/hyperloop-examples)

Import the sample application.

Run the application

Actual iOS 10

{noformat} [TRACE] : "Use Legacy Swift Language Version" (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax...] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. [ERROR] : Error details: "Use Legacy Swift Language Version" (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax...] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly. {noformat}

Actual iOS 9.3

{noformat} [ERROR] : An error occurred during build after 3s 167ms [ERROR] : the xcodebuild failed running from /Users/Josh/Documents/Appcelerator_Studio_Workspace/hyperloop-examples/Pods {noformat}

Expected

No error is shown and the application is built.

Comments

  1. Chee Kiat Ng 2016-08-31

    To solve this specific issue, you just have to add this in appc.js:
       	hyperloop: {
       		ios: {
       			xcodebuild: {
       				/**
       				 * any flags available to be passed into the Xcode can be
       				 * included here to further customize the xcode build
       				 */
       				flags: {
       					GCC_PREPROCESSOR_DEFINITIONS: 'foo=bar',
       					SWIFT_VERSION: '2.3'
       				},
       
    And the hyperloop examples will build correctly. HOWEVER, every example here is returning a ... is not a function. Mostly likely related to TIMOB-23812.

    environment

    Xcode 8 beta 6 titanium SDK latest master appc cli 5.5.0-5 appc npm 4.2.7
  2. Hans Knöchel 2016-09-02

    Talked with [~jvennemann] about this. We agreed that adding it automatically by the Hyperloop-CLI is the best way to solve this on the long-term perspective. Since we are already able to detect whether swift-sources are used in the project, we can hook it in there. Re-assigning to Jan.
  3. Hans Knöchel 2016-09-06

    Scheduling for Hyperloop 2.0.0 in the 6.0.0 timeframe. Shouldn't be too hard to detect swift-usage and adding the flag then.
  4. Hans Knöchel 2016-09-24

    Proof of concept: https://github.com/hansemannn/hyperloop.next/commit/4c09f3d081e68902dea55583558de10bc27b4511 However, although I am able to inject the currently selected Swift version with xcrun swift -version and inject it into the pbx build-settings, it seems to be injected too late, so the error is still thrown. The value from the appc.js is already injected in hookXcodebuild so we might need to detect the swift-usage there already. I hope that helps for the correct PR.
  5. Jan Vennemann 2016-09-30

    Took your approach and resolved the async issues that were causing errors ;) PR (master): https://github.com/appcelerator/hyperloop.next/pull/81 Does this need a 1_2_X backport?
  6. Chee Kiat Ng 2016-10-03

    [~jvennemann] yes please. Do a 1.2.9 please.
  7. Hans Knöchel 2016-10-03

    Putting the review on hold, since this issue is blocked by TIMOB-23971.
  8. Hans Knöchel 2016-10-07

    PR merged. [~jvennemann] Please do a 1.2.9 backport.
  9. Jan Vennemann 2016-10-10

    PR for the 1_2_X branch: https://github.com/appcelerator/hyperloop.next/pull/84
  10. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source