diff --git a/.cspell-wordlist.txt b/.cspell-wordlist.txt index defed32659..343751dcc0 100644 --- a/.cspell-wordlist.txt +++ b/.cspell-wordlist.txt @@ -450,3 +450,7 @@ eurollm doclayout netp Uyghur +cocoapods +ARCHS +Podfile +armeabi diff --git a/docs/docs/01-fundamentals/01-getting-started.md b/docs/docs/01-fundamentals/01-getting-started.md index a7548d3ecb..9c54b81ee5 100644 --- a/docs/docs/01-fundamentals/01-getting-started.md +++ b/docs/docs/01-fundamentals/01-getting-started.md @@ -89,7 +89,7 @@ yarn add react-native-executorch react-native-worklets react-native-blob-util ```bash -pnpm add react-native-executorch react-native-worklets react-native-blob-util +pnpm add react-native-executorch react-native-worklets react-native-blob-util --allow-build=react-native-executorch ``` @@ -131,12 +131,13 @@ worklets 0.10 accepts. ### Babel -The library runs inference on worklet threads, so add the worklets Babel plugin -to `babel.config.js`. It must be the **last** entry in `plugins`: +The library runs inference on worklet threads. Expo's `babel-preset-expo` adds +the worklets plugin by itself, so an Expo app needs no `babel.config.js` for it. +In a bare app, add the plugin as the **last** entry in `plugins`: ```js module.exports = { - presets: ['module:@react-native/babel-preset'], // or 'babel-preset-expo' + presets: ['module:@react-native/babel-preset'], plugins: [ // ...your other plugins 'react-native-worklets/plugin', diff --git a/docs/docs/03-core-and-advanced/08-native-libraries.md b/docs/docs/03-core-and-advanced/08-native-libraries.md index 680a93e368..c0a459bd91 100644 --- a/docs/docs/03-core-and-advanced/08-native-libraries.md +++ b/docs/docs/03-core-and-advanced/08-native-libraries.md @@ -56,11 +56,12 @@ The block is read from the directory the install was run in, then from every actually resolved, and the install log names the manifest it read. ::: -:::caution pnpm and npm 12 -pnpm 10 and later, and npm 12 and later, do not run dependency install scripts +:::caution pnpm, bun and npm 12 +pnpm 10 and later, bun, and npm 12 and later do not run dependency install scripts unless you allow them, so the download never happens and the native build fails -later on a missing file. Run `pnpm approve-builds react-native-executorch` or -`npm approve-scripts react-native-executorch` once. See +later on a missing file. Install with `--allow-build=react-native-executorch` +(pnpm), run `bun pm trust react-native-executorch` (bun) or +`npm approve-scripts react-native-executorch` (npm 12) once. See [Troubleshooting](../05-other/02-troubleshooting.md). ::: diff --git a/docs/docs/05-other/02-troubleshooting.md b/docs/docs/05-other/02-troubleshooting.md index c6949f9606..b012dbbc83 100644 --- a/docs/docs/05-other/02-troubleshooting.md +++ b/docs/docs/05-other/02-troubleshooting.md @@ -21,7 +21,9 @@ The native artifacts are not in the npm tarball. They are downloaded by a **postinstall** hook, and your package manager skipped it: - **pnpm 10 and later block dependency build scripts by default** and print - `Ignored build scripts: react-native-executorch` during install. + `Ignored build scripts: react-native-executorch` during install. Installing + with `--allow-build=react-native-executorch` avoids it. +- **bun** does the same for any package not in `trustedDependencies`. - **npm 12 and later** (and npm 11.16+ with `strict-allow-scripts=true`) skip install scripts of packages not listed in `allowScripts`, with only a warning. - `--ignore-scripts`, and `npm ci --ignore-scripts`, do the same. @@ -32,7 +34,8 @@ for the file. Recent versions fail during `pod install` (and during the Android configure phase) with this fix in the message instead. Re-run the hook: ```bash -pnpm approve-builds react-native-executorch # pnpm +pnpm approve-builds # pnpm, select it +bun pm trust react-native-executorch # bun npm approve-scripts react-native-executorch # npm 12+, then: npm rebuild react-native-executorch # npm node node_modules/react-native-executorch/scripts/download-libs.js @@ -72,9 +75,9 @@ turns that off again. statically linked binaries: (.../opencv-rne/opencv2.xcframework) ``` -`use_frameworks!` with no argument means **dynamic** linkage, which CocoaPods -refuses to combine with a statically linked dependency. Ask for static -frameworks instead: +Versions before 0.11 could not be built with **dynamic** frameworks, which +`use_frameworks!` with no argument means and which `@react-native-firebase` 27+ +requires. Update the library; on an older version, ask for static frameworks: ```ruby use_frameworks! :linkage => :static @@ -136,13 +139,35 @@ image. Use an Apple silicon machine, or a physical device. ``` This is a **warning**, so `pod install` still succeeds and the failure surfaces -later. The library needs iOS 17. In an Expo app, set it explicitly — the default -is lower: +later. On the bare template, whose default is iOS 15.1, `pod install` fails +instead: `required a higher minimum deployment target`. The library needs iOS +17: set `platform :ios, '17.0'` in the `Podfile`, or in an Expo app: ```json ["expo-build-properties", { "ios": { "deploymentTarget": "17.0" } }] ``` +## `deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0` + +``` +error: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set +to 11.0, but the range of supported deployment target versions is 15.0 to 27.2.x. +(in target 'react-native-blob-util-ReactNativeBlobUtilPrivacyInfo') +``` + +`react-native-blob-util` 0.25 declares iOS 11, which Xcode 27 rejects. Expo SDK +56 and later fix this up for you; elsewhere raise its targets in the `Podfile`: + +```ruby +post_install do |installer| + installer.pods_project.targets.each do |t| + t.build_configurations.each do |c| + c.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.1' if c.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 15.0 + end + end +end +``` + ## The `react-native-executorch` config block is ignored The postinstall hook reads the block from the directory where the install was diff --git a/packages/react-native-executorch/android/build.gradle.kts b/packages/react-native-executorch/android/build.gradle.kts index 8dfea64165..0805289095 100644 --- a/packages/react-native-executorch/android/build.gradle.kts +++ b/packages/react-native-executorch/android/build.gradle.kts @@ -75,12 +75,13 @@ fun requireNativeArtifacts() { ${libsDir.absolutePath} They are downloaded by this package's postinstall hook, which your - package manager did not run. pnpm 10 and later block dependency build - scripts by default ("Ignored build scripts"), npm 12 skips install - scripts not listed in `allowScripts`, and `--ignore-scripts` does the - same. Re-run the hook: + package manager did not run. pnpm 10 and later, and bun, block + dependency build scripts by default ("Ignored build scripts"), npm 12 + skips install scripts not listed in `allowScripts`, and + `--ignore-scripts` does the same. Re-run the hook: - pnpm approve-builds react-native-executorch # pnpm + pnpm approve-builds # pnpm, select it + bun pm trust react-native-executorch # bun npm approve-scripts react-native-executorch # npm 12+, then: npm rebuild react-native-executorch # npm node node_modules/react-native-executorch/scripts/download-libs.js diff --git a/packages/react-native-executorch/react-native-executorch.podspec b/packages/react-native-executorch/react-native-executorch.podspec index a412d21a42..985f7c3e99 100644 --- a/packages/react-native-executorch/react-native-executorch.podspec +++ b/packages/react-native-executorch/react-native-executorch.podspec @@ -50,12 +50,13 @@ unless missing.empty? #{missing.map { |path| " #{path}" }.join("\n")} They are downloaded by this package's postinstall hook, which your package - manager did not run. pnpm 10 and later block dependency build scripts by - default ("Ignored build scripts"), npm 12 skips install scripts not listed - in `allowScripts`, and `--ignore-scripts` does the same. Re-run the hook, + manager did not run. pnpm 10 and later, and bun, block dependency build + scripts by default ("Ignored build scripts"), npm 12 skips install scripts + not listed in `allowScripts`, and `--ignore-scripts` does the same. Re-run the hook, then `pod install` again: - pnpm approve-builds react-native-executorch # pnpm + pnpm approve-builds # pnpm, select it + bun pm trust react-native-executorch # bun npm approve-scripts react-native-executorch # npm 12+, then: npm rebuild react-native-executorch # npm node node_modules/react-native-executorch/scripts/download-libs.js