49

This is the error that i am getting when building the app.

I am getting this error after upgrading my react-native version from 0.66.2 to 0.68.2 in my Appdelegate.mm file.

enter image description here

sakshya73
  • 5,570
  • 5
  • 22
  • 41

1 Answers1

166

After some research i found out that jsBundleURLForBundleRoot:fallbackResource: no longer exists on RCTBundleURLProvider.

Here's the Fix:

Replace

return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

with

return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];

Re-Build the app and you are good to go.

sakshya73
  • 5,570
  • 5
  • 22
  • 41
  • 2
    Thanks very much, same upgrade journey as you! (66 to 69) – Nabil Freeman Aug 01 '22 at 17:33
  • 1
    Fixed my error that was: The following build commands failed: CompileC /Users/.../Library/Developer/Xcode/DerivedData/...-cnhglescntkhmbendriezncnfrun/Build/Intermediates.noindex/...build/Debug-iphonesimulator/....build/Objects-normal/arm64/AppDelegate.o /Users/.../repos/.../ios/.../AppDelegate.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler – SeanMC Aug 19 '22 at 21:43
  • Adding this note for other encountering a similar issue after using this fix then upgrading to the macOS Monterey 12.6.1 -> I had been using this patch (and it worked great!) but was causing the same error after the latest update. Reverting it fixed the issue. – Shep Sims Nov 15 '22 at 23:44
  • 1
    Thank you so much. The above solution worked and saved time. – Sakthivel Jan 19 '23 at 12:47
  • 1
    Love you, man ! – Badr Filali Feb 14 '23 at 09:20
  • You're a Legend!! Thank you so much! – 0xe1λ7r Feb 17 '23 at 16:41
  • Tried this but then it just says: ```Can't find the 'node' binary to build the React Native bundle. If you have a non-standard Node.js installation, select your project in Xcode, find 'Build Phases' - 'Bundle React Native code and images' and change NODE_BINARY to an absolute path to your node executable. You can find it by invoking 'which node' in the terminal.``` – Mark Lanham Feb 21 '23 at 10:40
  • Thanks so much! The same issue occurred to me by upgrading from Expo SDK 44 to 45. – Robin de Rozario Apr 15 '23 at 14:16