config-plugins
config-plugins copied to clipboard
React-native-branch incompatibility with Expo SDK 53: iOS Build fails with "cannot find type 'RCTBridge' in scope"
Summary
EAS Build for iOS fails when using Expo SDK from 53, @config-plugins/react-native-branch (v10.0.0) and react-native-branch. The error is:
error: cannot find type 'RCTBridge' in scope
AppDelegate.swift: override func sourceURL(for bridge: RCTBridge) -> URL? {
The build works perfectly with Expo SDK 52 and @config-plugins/react-native-branch V9.0.0 Disabling the new architecture ("newArchEnabled": false) does not solve the issue. The project is managed (no local ios/ folder), using EAS Build. No custom native code All dependencies are aligned with the official compatibility table.
Config Plugin
@config-plugins/react-native-branch
What platform(s) does this occur on?
iOS
SDK Version
53
Reproducible demo
- Create a new Expo SDK 53 project.
- Install react-native-branch and @config-plugins/react-native-branch.
- Add the recommended configuration to app.json.
- Run an EAS Build for iOS.
I have the same issue upgrading to Expo SDK 53 and can't seem to find anywhere whether Branch supports the new architecture.
On Android, it builds successfully.
Some advice would be very helpful.
We're SOL https://github.com/expo/config-plugins/issues/270
I’m also encountering this issue on Expo SDK 53 (@config-plugins/[email protected] + [email protected]) with the same RCTBridge error on iOS.
The urgency for fixing this is increasing because Google Play Console now requires all apps to target Android 15 (API level 35) by August 31. Upgrading to Expo SDK 53 is currently the only viable path to comply with this, but this Branch-related issue blocks that upgrade.
If there’s no timely resolution, we might be forced to consider removing Branch from our app, which would be unfortunate given its usefulness.
Anyone else in the same situation, I encourage you to also submit a support ticket to Branch, since Expo maintainers have clarified they cannot fix this from their side.
I’m also encountering this issue on Expo SDK 53 (@config-plugins/[email protected] + [email protected]) with the same RCTBridge error on iOS.
The urgency for fixing this is increasing because Google Play Console now requires all apps to target Android 15 (API level 35) by August 31. Upgrading to Expo SDK 53 is currently the only viable path to comply with this, but this Branch-related issue blocks that upgrade.
If there’s no timely resolution, we might be forced to consider removing Branch from our app, which would be unfortunate given its usefulness.
Anyone else in the same situation, I encourage you to also submit a support ticket to Branch, since Expo maintainers have clarified they cannot fix this from their side.
Hi! You can target API level 35 with Expo SDK 52 by using the expo-build-properties plugin and setting it manually in your config:
"plugins": ["expo-build-properties"],
"expo-build-properties": {
"android": {
"targetSdkVersion": 35
}
}
It worked for me :-)
We're also looking for alternatives to Branch right now. It's too bad the Firebase Dynamic Link is shutting down...
I’m also encountering this issue on Expo SDK 53 (@config-plugins/[email protected] + [email protected]) with the same RCTBridge error on iOS. The urgency for fixing this is increasing because Google Play Console now requires all apps to target Android 15 (API level 35) by August 31. Upgrading to Expo SDK 53 is currently the only viable path to comply with this, but this Branch-related issue blocks that upgrade. If there’s no timely resolution, we might be forced to consider removing Branch from our app, which would be unfortunate given its usefulness. Anyone else in the same situation, I encourage you to also submit a support ticket to Branch, since Expo maintainers have clarified they cannot fix this from their side.
Hi! You can target API level 35 with Expo SDK 52 by using the expo-build-properties plugin and setting it manually in your config:
"plugins": ["expo-build-properties"], "expo-build-properties": { "android": { "targetSdkVersion": 35 } }It worked for me :-)
Thanks for the tip — that’s super helpful!
If targeting API level 35 works reliably with SDK 52 using expo-build-properties, that could buy us a bit of time while the Branch issue on SDK 53 gets sorted out. I’ll test it out and see if it passes Play Console checks.
Appreciate you sharing it!
We’re currently stuck on this issue, and it needs to be resolved as soon as possible.
same problem here, waiting solution...
Same issue.
I opened a support ticket with branch.io and they closed it with a generic response as expected. Still holding onto hope.
This happens because the Swift bridging header does not automatically import RCTBridge. I ran into this while running npx expo prebuild and the build kept failing with errors like
cannot find type 'RCTBridge' in scope
Good news is I found a workaround using a custom Expo config plugin.
Solution:
- Create a plugin file (e.g.,
./plugins/withReactBridgeHeader.js):
const fs = require('fs');
const path = require('path');
const withReactBridgeHeader = (config) => {
return {
...config,
ios: {
...config.ios,
hooks: {
postPrebuild: () => {
const iosDir = config.ios?.projectPath || 'ios';
const headerFile = path.join(iosDir, config.name, `${config.name}-Bridging-Header.h`);
if (fs.existsSync(headerFile)) {
let content = fs.readFileSync(headerFile, 'utf-8');
const importLine = '#import <React/RCTBridge.h>';
if (!content.includes(importLine)) {
content = content + '\n' + importLine;
fs.writeFileSync(headerFile, content, 'utf-8');
console.log('[withReactBridgeHeader] Added React import to bridging header');
}
} else {
console.warn(`[withReactBridgeHeader] Bridging header not found at ${headerFile}`);
}
},
},
},
};
};
module.exports = withReactBridgeHeader;
- Use the plugin in your
app.config.js:
const withReactBridgeHeader = require('./plugins/withReactBridgeHeader');
export default {
expo: {
name: "YourApp",
slug: "your-app",
plugins: [
// other plugins...
withReactBridgeHeader,
],
},
};
- Clean and rebuild the project:
rm -rf ios/Pods ios/Podfile.lock ios/Podfile.xcworkspace ios/build
npx expo prebuild --clean
cd ios && pod install && cd ..
npx expo run:ios
This ensures the bridging header includes the necessary import, so your Swift code compiles correctly after prebuilds.
Let me know if that worked for you!
Have the same issue with expo 54
@hassankhan Any plan to support branch in Expo v54
@hassankhan Any plan to support branch in Expo v54
The branch seems to be ready https://github.com/expo/config-plugins/tree/upgrade-to-v54-stacked I'm waiting for the PR ... 👀
@hassankhan Any plan to support branch in Expo v54
The branch seems to be ready
upgrade-to-v54-stackedI'm waiting for the PR ... 👀
So, does this mean this entire GitHub issue is expected to be resolved for Expo v54?
So, does this mean this entire GitHub issue is expected to be resolved for Expo v54?
There appears to be code to add the necessary bridge header similar to the workaround @briansztamfater posted (which we've been using for expo 53).
So that should both support expo 54 (bumping versions) and workaround the RCTBridge issue (which seems to be more of a react-native-branch issue than the config plugin itself)
I also experienced the same issue with the latest Expo version ^54.0.10. Looking forward to the fix whenever it’s ready. 🙌
Hi @hassankhan, thanks for the earlier work on this issue 🙏.
I just wanted to note that I’m still experiencing the same problem on Expo SDK 54 after pulling the latest changes. The error persists during EAS Build for iOS.
Environment:
- Expo SDK: 54
- @config-plugins/react-native-branch: ^11.0.0
- react-native-branch: ^6.8.0
To help with debugging, I’ve put together:
- Minimal reproducible repo: RCTBridge Issue (SDK 54)
- New issue with full details: Expo SDK 54 RCTBridge Issue
Could you confirm if support for SDK 54 is expected, or if additional configuration steps are needed?