well it’s definitely issues with the New Relic package.
It seems the android build fails when I have the
newrelic-react-native-agent enabled in the
plugins of my app.config. I think we need to follow their documentation and include it? We are not using ExpoGo, but the EAS + Managed workflow now since we have modules that aren’t supported by ExpoGo.
What’s your understanding on needing to include the item in the plugins?
Yes, you would need the config plugin for it to work in a production app or a development build. And since New Relic includes native code you won’t be able to call it when it’s running in Expo Go. You can still run your app in Expo Go if you avoid calling New Relic when it’s running in Expo Go. The New Relic docs point you to the Custom native code in Expo Go docs which explain how to do that. But that won’t really help you, because you would still need to use the plugin in the production version of the app.
So yes, you’d need to follow their documentation, but this part of their documentation is wrong, or at best misleading:
After this, you need to use the
expo prebuild --cleancommand as described in the “Adding custom native code” guide to rebuild your app with the plugin changes. If this command is not running, you’ll get errors when starting the New Relic agent.
You do not need to run
npx expo prebuild yourself. Running
npx expo prebuild effectively switches you to the bare workflow. Also, the build servers automatically run
npx expo prebuild for managed workflow apps.
See step 8 of the “remote steps” in the iOS build process documenation:
- Additional step for managed projects: Run
npx expo prebuildto convert the project to a bare one. This step will use the versioned Expo CLI for projects that use Expo SDK 46+. In SDK 48 and lower, you can still choose to use the (deprecated) global Expo CLI installation by setting
EXPO_USE_LOCAL_CLI=0in the build profile.
I think you might have more luck with it if you upgrade to a later version of the Expo SDK.
Otherwise you might need to debug their config plugin and/or the New Relic SDK. Or ask them for more ideas.