react-native-app-clip icon indicating copy to clipboard operation
react-native-app-clip copied to clipboard

xcode archive build fails on expo sdk v48 starting with v0.2.1

Open david-arteaga opened this issue 2 years ago • 0 comments

Repro

  • Generate a new expo project with the the v48 sdk: npx create-expo-app expo-48-app-clip-test --template blank@sdk-48
  • Configure the plugin in app.json
[
  "react-native-app-clip",
  {
    "name" : "My App Clip",
    "deploymentTarget": "14.0",
    "appleSignin": false
  }
],
  • Generate the xcode project: yarn expo prebuild --clean --platform ios
  • Configure signing for the project.
  • Run the Archive build (Product -> Archive)
  • Archive build fails with File /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/undefined.app/main.jsbundle does not exist. This must be a bug with React Native, please report it here: https://github.com/facebook/react-native/issues

Details

v0.1.4 works fine.

Starting with v0.2.1 (I haven't been able to install v0.2.0 from npm) I get an error during the Bundle React Native code and images xcode build phase.

These are the couple of lines of logs just before the error pops up:

hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
  hermes-engine:
    :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
  hermes-engine: d7cc127932c89c53374452d6f93473f1970d8e88 ]]
+ [[ -f /Users/davidarteaga/projects/toptal/cheez/code/app-clips/expo-48-app-clip/ios/Pods/hermes-engine ]]
+ '[' -z '' ']'
+ export NODE_ARGS=
+ NODE_ARGS=
+ '[' -z /Users/davidarteaga/projects/toptal/cheez/code/app-clips/expo-48-app-clip/node_modules/@expo/cli/build/bin/cli ']'
+ '[' -z export:embed ']'
+ '[' -z '' ']'
+ COMPOSE_SOURCEMAP_PATH=/Users/davidarteaga/projects/toptal/cheez/code/app-clips/expo-48-app-clip/node_modules/react-native/scripts/compose-source-maps.js
+ [[ -z '' ]]
+ CONFIG_ARG=
+ BUNDLE_FILE=/Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/main.jsbundle
+ EXTRA_ARGS=
+ case "$PLATFORM_NAME" in
+ BUNDLE_PLATFORM=ios
+ '[' '' = YES ']'
+ EMIT_SOURCEMAP=
+ [[ ! -z '' ]]
+ PACKAGER_SOURCEMAP_FILE=
+ [[ '' == true ]]
+ [[ '' != false ]]
+ [[ false == false ]]
+ EXTRA_ARGS=' --minify false'
+ /Users/davidarteaga/.nvm/versions/node/v18.18.2/bin/node /Users/davidarteaga/projects/toptal/cheez/code/app-clips/expo-48-app-clip/node_modules/@expo/cli/build/bin/cli export:embed --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/main.jsbundle --assets-dest /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/undefined.app --minify false
Unknown or unexpected option: --entry-file
+ [[ '' == false ]]
+ EXTRA_COMPILER_ARGS=
+ [[ false == true ]]
+ EXTRA_COMPILER_ARGS=-O
+ [[ '' == true ]]
+ /Users/davidarteaga/projects/toptal/cheez/code/app-clips/expo-48-app-clip/ios/Pods/hermes-engine/destroot/bin/hermesc -emit-binary -O -out /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/undefined.app/main.jsbundle /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/main.jsbundle
Error! Failed to open file: /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/main.jsbundle
+ [[ '' == true ]]
+ BUNDLE_FILE=/Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/undefined.app/main.jsbundle
+ [[ false != true ]]
+ [[ ! -f /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/undefined.app/main.jsbundle ]]
+ echo 'error: File /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/undefined.app/main.jsbundle does not exist. This must be a bug with React Native, please report it here: https://github.com/facebook/react-native/issues'
error: File /Users/davidarteaga/Library/Developer/Xcode/DerivedData/expo48appclip-brlnlvwypirybpgjfwpzwzvqfclv/Build/Intermediates.noindex/ArchiveIntermediates/expo48appclip/BuildProductsPath/Release-iphoneos/undefined.app/main.jsbundle does not exist. This must be a bug with React Native, please report it here: https://github.com/facebook/react-native/issues
+ exit 2

The part that seems interesting is Unknown or unexpected option: --entry-filea and the line right before that. It seems like that flag is causing an error and not letting the bundler run.

The metro bundler server never starts when I run the Archive build.

It does start when I use v0.1.4, and the archive build completes successfully, so the issue was probably introduced in v0.2.0 or v0.2.1.

The package does work with expo sdk v49, but the readme mentions react-native-app-clip requires Expo SDK 48.

If the fix is too complex then maybe at least the readme could be updated to react-native-app-clip requires Expo SDK 49, and then mention that the last version that works with Expo SDK v48 is v0.1.4.

In any case, thanks for building this awesome plugin!

david-arteaga avatar Oct 20 '23 15:10 david-arteaga