Detox: Error detox on Xcode 10.2

Created on 26 Mar 2019  ·  5Comments  ·  Source: wix/Detox

Describe the bug
After I upgraded the version of Xcode to 10.2, I can't build my React Native project with detox error.

Environment (please complete the following information):

  • Detox: 9.0.2 (Though this is not the latest version, I can't upgrade detox version as long as I use Xcode 10.2)
  • React Native: 0.57.8
  • Node: 8.15.1
  • Xcode: 10.2
  • macOS: 10.14.3

Device and Verbose Detox Logs

Exit code: 1
Command: node scripts/postinstall.js
Arguments: 
Directory: /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox
Output:
+ xcodebuild -version
+++ dirname /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/scripts/build_framework.ios.sh
++ dirname /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/scripts
+ detoxRootPath=/Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox
++ node -p 'require('\''/Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/package.json'\'').version'
+ detoxVersion=11.0.2
++ echo 11.0.2
++ xcodebuild -version
++ shasum
++ awk '{print $1}'
+ sha1=0d38829e969f1495b036f6081be1befa587b4a7a
+ detoxFrameworkDirPath=/Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a
+ detoxFrameworkPath=/Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a/Detox.framework
+ main
+ '[' -d /Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a ']'
+ '[' '!' -d /Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a/Detox.framework ']'
+ echo '/Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a was found, but could not find Detox.framework inside it. This means that the Detox framework build process was interrupted.
         deleting /Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a and trying to rebuild.'
/Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a was found, but could not find Detox.framework inside it. This means that the Detox framework build process was interrupted.
         deleting /Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a and trying to rebuild.
+ rm -rf /Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a
+ prepareAndBuildFramework
+ '[' -d /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios ']'
+ detoxSourcePath=/Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src
+ extractSources /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src
+ detoxSourcePath=/Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src
+ echo 'Extracting Detox sources...'
Extracting Detox sources...
+ mkdir -p /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src
+ tar -xjf /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/Detox-ios-src.tbz -C /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src
+ buildFramework /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src
+ detoxSourcePath=/Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src
+ echo 'Building Detox.framework from /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src...'
+ mkdir -p /Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a
Building Detox.framework from /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src...
+ /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/scripts/build_universal_framework.sh /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/ios_src/Detox.xcodeproj /Users/junhui/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a
child_process.js:630
    throw err;
    ^

Error: Command failed: /Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/scripts/build_framework.ios.sh
    at checkExecSyncError (child_process.js:607:13)
    at Object.execFileSync (child_process.js:627:13)
    at Object.<anonymous> (/Users/junhui/Workspace/redkiwi/packages/redkiwi-app/node_modules/detox/scripts/postinstall.js:2:27)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
acceptebug ios

Most helpful comment

Yes, I will push a fix for this soon. Xcode 10.2 doesn't support the version of Swift we use.

All 5 comments

I'm having the exact problem the output of
cat /Users/apple/Library/Detox/ios/0d38829e969f1495b036f6081be1befa587b4a7a/detox_ios.log

=== BUILD TARGET Detox OF PROJECT Detox WITH CONFIGURATION Release ===

Check dependencies
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 4.0, 4.2, 5.0. This setting can be set in the build settings editor.

** BUILD FAILED **


The following build commands failed:
        Check dependencies
(1 failure)

Yes, I will push a fix for this soon. Xcode 10.2 doesn't support the version of Swift we use.

We will be releasing a major version soon.

Thanks for creating this issue. I've been grabbing my hair for hours now! For anyone's reference, I'm gonna leave what I experienced.

I just started using Detox in my project yesterday evening and everything was working just fine. Today morning upgraded XCode and things haven't been working ever since.

After upgrade detox test command stopped working and the error was suggesting either XCode or Detox has been updated and to clear and rebuild detox cache. This wasn't working for me and after some digging around I decided to uninstall Detox and now I can't install it again.

npm install detox --save-dev fails with the error,

Error: Command failed: /Users/janithar/Desktop/mobile_react_native/ProfessionalApp/node_modules/detox/scripts/build_framework.ios.sh
    at checkExecSyncError (child_process.js:637:11)
    at Object.execFileSync (child_process.js:655:13)
    at Object.<anonymous> (/Users/janithar/Desktop/mobile_react_native/ProfessionalApp/node_modules/detox/scripts/postinstall.js:2:27)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:862:12)
    at internal/main/run_main_module.js:21:11

Detox 12 has been released with Xcode 10.2 support and minimum Xcode version of 10.1.

Was this page helpful?
0 / 5 - 0 ratings