OpenNative / open-native

Open Native brings cross-platform communities together to help them collaborate and strengthen each other through development diversity.
https://open-native.org/
MIT License
459 stars 8 forks source link

Autolinking for react-native-webview fails #32

Closed mariokehl closed 3 months ago

mariokehl commented 3 months ago

NS 8.8.1

package.json:

    "@open-native/core": "^2.0.0",
    "react-native-webview": "^13.6.3",
    "@ammarahmed/nativescript-webview": "^1.0.9",

I'm receiving this error during ns run ios, while ns run android is doing fine:

 ✘ ns run ios
Searching for devices...
[@open-native/core/hooks/before-prepare.js] Autolinking React Native ios native modules...
[@open-native/core/hooks/prepare-ios.js]: Writing react-native-webview.podspec
Error: Command failed: pod ipc spec /Users/mario/Development/VSCodeProjects/my-app/node_modules/react-native-webview/react-native-webview.podspec

    at ChildProcess.exithandler (node:child_process:419:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:320:12) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'pod ipc spec /Users/mario/Development/VSCodeProjects/my-app/node_modules/react-native-webview/react-native-webview.podspec',
  stdout: '\n' +
    '[!] Invalid `react-native-webview.podspec` file: else without rescue is useless\n' +
    '  else\n' +
    '  ^~~~\n' +
    "/Users/mario/Development/VSCodeProjects/my-app/node_modules/react-native-webview/react-native-webview.podspec:44: syntax error, unexpected `end', expecting end-of-input.\n" +
    '\n' +
    ' #  from /Users/mario/Development/VSCodeProjects/my-app/node_modules/react-native-webview/react-native-webview.podspec:22\n' +
    ' #  -------------------------------------------\n' +
    ' #  \n' +
    ' >    else\n' +
    ' #      if new_arch_enabled\n' +
    ' #  -------------------------------------------\n',
  stderr: ''
}
mariokehl commented 3 months ago

i don't see exactly why this happend, the podspec looked like this:

  else
    if new_arch_enabled

Which should have been something like:

  if defined?(install_modules_dependencies()) != nil
    install_modules_dependencies(s);
  else
    if new_arch_enabled

After doing npm remove react-native-webview the right code of v13.6.3 was restored and now it is working.