EAS build fails SDK 47 iOS - File not found in react-native-maps

Hi,

Before the update to SDK 47 our builds were running ok on both iOS and Android. However, since then, iOS builds are failing in the fastlane section of the build with the following error

#import <React/RCTViewManager.h>
#import <React/UIView+React.h>
#import “RCTConvert+AirMap.h”
^ ‘RCTConvert+AirMap.h’ file not found
#import “AIRGoogleMapPolyline.h”

@interface AIRGoogleMapPolylineManager()

› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapPolyline.m
› Compiling react-native-maps Pods/react-native-google-maps » AIRGoogleMapPolygonManager.m
(node_modules/react-native-maps/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m:17:9)

Android is able to complete the build successfully and work as intended.

This is on the managed workflow, eas-cli version 2.7.1

Failed build on iOS Build Details — 41df0ef8-5cb7-472e-af74-dcfc05462247 — Cardiff-Students-Dev — Expo
Working build on iOS without react-native-maps Build Details — 78dcd799-7290-493c-8233-2bf02e651079 — Cardiff-Students-Dev — Expo
Working build on Android https://expo.dev/accounts/cardiff-university/projects/Cardiff-Students-Dev/builds/35401e5a-643d-4763-b83a-4e14424d32c8

hi there!

i’d suggest looking on the react-native-maps issues, eg: 'RCTConvert+AirMap.h' file not found · Issue #3597 · react-native-maps/react-native-maps · GitHub

So we believe we have found the issue although we need to do more testing.

It appears react-native-maps and the new way of using Firebase Analytics in Expo 47 are not working together in the same project. It would be great to get some more clarity on why this is the case

Hi @cardiffuniversity

I think this is the discussion you’re looking for:

It seems that current versions of Firebase require “use_frameworks!”, while react-native-maps doesn’t yet support it (or the version you’re using doesn’t?). I just skimmed the discussion, but it seems that some people were able to get Firebase and RN Maps to work together.

Thanks, I’ve had a look at this before and was hoping something else was amiss but it looks like I’ll be implementing this at a later date.

It’s a shame because this is 2 key points of Expo 47 (upgrading react-native-maps to 1.3.2 and moving to the plugin format for analytics) and yet both don’t actually work together easily unless you have your own custom plugin on top

If I understand correctly, this is caused by one dependency that requires “use_frameworks! :linkage => :static” and another that is incompatible with “use_frameworks! :linkage => :static”.

But react-native-maps 1.3.2 supposedly fixes the issue with “use_frameworks! :linkage => :static”, so in theory things should now work.

I’ve just created a new Expo SDK 47 app, installed react-native-maps and @react-native-firebase/analytics with:

npx expo install react-native-maps @react-native-firebase/app @react-native-firebase/analytics expo-build-properties

Added the following to app.json:

    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ]

and I was able to build and run the app.

If I check the version of react-native-maps that’s installed, I see it’s 1.3.2:

$ npm why react-native-maps
react-native-maps@1.3.2
node_modules/react-native-maps
  react-native-maps@"1.3.2" from the root project

Could you provide some more information about your setup (dependencies, devDependencies, plugins, etc.) so that I might reproduce the problem on my side?

Hi Wodin,

Apologies for the delay, we put this on hold as we needed to release our app so this got temporarily shelved.

This is how our current app.config.js looks

plugins: [
    [
      'expo-build-properties',
      {
        ios: {
          useFrameworks: 'static'
        }
      }
    ],
    'sentry-expo',
    '@react-native-firebase/app',
    '@react-native-firebase/analytics'
  ],

This however does not run because of the following error
PluginError: Package "@react-native-firebase/analytics" does not contain a valid config plugin.

As far as I can tell, I’ve followed the instructions both from React Native Firebase | React Native Firebase and Using Firebase - Expo Documentation

Hi

Not everything that includes native code needs a config plugin. For some dependencies, the React Native or Expo autolinking is sufficient.

The RN Firebase docs say:

After installing the @react-native-firebase/app NPM package, add the config plugin to the plugins array of your app.json or app.config.js.

While I think the docs could be a lot clearer about this step, I believe they are saying that @react-native-firebase/app needs a config plugin, but e.g. @react-native-firebase/analytics does not.

The source code suggests this too:

So you should remove the following line from your plugins array:

Any solutions on this ? I have exactly the same error

What are your dependencies and devDependencies and what do you have in your plugins array in app.json?

Also, what does npm why react-native-maps give you?

I managed to make it work by upgrading to SDK47, and add a custom config to app.config plugins

So it didn’t work with "react-native-maps": "1.3.2" unless you also added the config plugin?

yes exactly

could you give me an example of how to do it?