webdriverio / native-demo-app

Guinea pig app for showcasing test automation with WebdriverIO and Appium

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IOS real device build failure

itkhanz opened this issue · comments

Environment:
JDK 17.0.2
Appium 2.0
appium-java-client 8.5.1
Node v18.16.0
NPM 9.6.7
macOS Ventura 13.4
XCode 14.3
Real Device iPhone 11 (iOS 16.3)

Describe the bug
Unable to install on iOS real device.
XCode Build fails because of the legacy dependencies in the project.

To Reproduce
Download the source code.
Make sure that the cocoapods gem and ruby environment is already setup.
Navigate to ios folder and open the terminal. Run the command pod install to download all the dependencies.
Open wdioNativeDemoApp.xcworkspace file in ios directory.
Configure your bundleID and team in signing capabilities.
Choose minimum deployment according to IOS version i.e. 16.3.
Additionaly change the minimum deployment in Podfile also to this version.
Click on Product -> Build
Build fails with following two errors:
https://stackoverflow.com/questions/75897834/use-of-bitwise-with-boolean-operands-xcode-14-3-fails-builds-using-react-n

I fixed the abover error by replacing the bitwise operator with boolean operand. and rebuild the project.
The build fails in the end with the following error:
https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

As per the thread, it is related to the older ssl dependency in the older node version.

Expected behavior

Build should be successfull with no errors.

Screenshots

The console output is as follows:

info React Native v0.72.3 is now available (your project is running on v0.64.1).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.72.3.
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.64.1.
info To upgrade, run "react-native upgrade".
Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at stableHash (/Users/xxxx/Downloads/native-demo-app/node_modules/metro-cache/src/stableHash.js:19:8)
    at Object.getCacheKey (/Users/xxxx/Downloads/native-demo-app/node_modules/metro-transform-worker/src/index.js:647:7)
    at getTransformCacheKey (/Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/DeltaBundler/getTransformCacheKey.js:32:19)
    at new Transformer (/Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/DeltaBundler/Transformer.js:180:28)
    at /Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/Bundler.js:58:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

XCode log shows this error:

Command PhaseScriptExecution failed with a nonzero exit code

Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at stableHash (/Users/xxxx/Downloads/native-demo-app/node_modules/metro-cache/src/stableHash.js:19:8)
    at Object.getCacheKey (/Users/xxxx/Downloads/native-demo-app/node_modules/metro-transform-worker/src/index.js:647:7)
    at getTransformCacheKey (/Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/DeltaBundler/getTransformCacheKey.js:32:19)
    at new Transformer (/Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/DeltaBundler/Transformer.js:180:28)
    at /Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/Bundler.js:58:29
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
error Cannot read properties of undefined (reading 'transformFile').
TypeError: Cannot read properties of undefined (reading 'transformFile')
    at /Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/Bundler.js:95:34
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/Bundler.js:14:24)
    at _next (/Users/xxxx/Downloads/native-demo-app/node_modules/metro/src/Bundler.js:36:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
info Run CLI with --verbose flag for more details.
Command PhaseScriptExecution failed with a nonzero exit code

Additional context
Please update the documentation for building the app on iOS real devices.

The app is updated to RN 0.73.1, please:

  • fetch the latest main
  • check the docs from RN because some things have changed

and retry