Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expo installation instructions fail with error: "Setting $RNMapboxMapsImpl is now required" #3234

Closed
wvteijlingen opened this issue Dec 4, 2023 · 16 comments

Comments

@wvteijlingen
Copy link

Environment

  • Dev OS: macOS 14.1.2

Steps to reproduce

  1. Follow the exact instructions at: https://github.com/rnmapbox/maps/blob/main/plugin/install.md#plugin-configuration
  2. Run npx expo run:ios

The error message is quite cryptic, and the provided URL (https://github.com/rnmapbox/maps/wiki/Deprecated-RNMapboxImpl-Unset#ios) isn't very clear on how to fix this either. It just refers the the iOS installation instructions for a bare iOS workflow.

Result

npx expo run:ios
⚠️  Something went wrong running `pod install` in the `ios` directory.
Command `pod install` failed.
└─ Cause: Invalid `Podfile` file: 
[!] Invalid `rnmapbox-maps.podspec` file: Setting $RNMapboxMapsImpl is now required - https://github.com/rnmapbox/maps/wiki/Deprecated-RNMapboxImpl-Unset#ios.

 #  from <project_dir>/node_modules/@rnmapbox/maps/rnmapbox-maps.podspec:88
 #  -------------------------------------------
 #  unless $RNMapboxMapsImpl
 >    raise "Setting $RNMapboxMapsImpl is now required - https://github.com/rnmapbox/maps/wiki/Deprecated-RNMapboxImpl-Unset#ios"
 #  end
 #  -------------------------------------------
.

 #  from <project_dir>/WandelApp/ios/Podfile:52
 #  -------------------------------------------
 #    use_expo_modules!
 >    config = use_native_modules!
 #  
 #  -------------------------------------------
Copy link

github-actions bot commented Dec 4, 2023

No code example found in issue body - More info

@wvteijlingen
Copy link
Author

No code example found in issue body - More info

Not sure what code I am supposed in include here. The issue is with the installation procedure.

@mfazekas
Copy link
Contributor

mfazekas commented Dec 4, 2023

Pls add info so the issue can be reproduced. What is your expo version? What is the rnmapbox version what is your plugin config.

@hamsterhomka
Copy link

Same problem. Why Isn't the need to pass another parameter RNMapboxMapsImpl: 'mapbox' even mentioned in the guide for the expo plugin? And even after passing it I am still getting an error

import MapboxMaps
 ^ compiling for iOS 11.0, but module 'MapboxMaps' has a minimum deployment target of iOS 12.0: 
image

I am using expo SDK 49 and my deploymentTarget is 13.0

@Ladvace
Copy link

Ladvace commented Dec 5, 2023

Same problem here:

image

@maxkudla
Copy link

maxkudla commented Dec 7, 2023

Same problem. Why Isn't the need to pass another parameter RNMapboxMapsImpl: 'mapbox' even mentioned in the guide for the expo plugin? And even after passing it I am still getting an error

import MapboxMaps
 ^ compiling for iOS 11.0, but module 'MapboxMaps' has a minimum deployment target of iOS 12.0: 
image I am using expo SDK 49 and my deploymentTarget is 13.0

Have u fixed an issue?

@EgorKrasno
Copy link

EgorKrasno commented Dec 7, 2023

Running npx expo prebuild fixed this issue for me.

But now I am getting compiling for iOS 11.0, but module 'MapboxMaps' has a minimum deployment target of iOS 12.0, I have it set to 13 in the build properties.

Now to fix that issue I removed "RNMapboxMapsVersion": "11.0.0",, which drops me to Mapbox V10. But at least it works.

@Ladvace
Copy link

Ladvace commented Dec 7, 2023

adding this in ios > Podfile fixed the problem for me

$RNMapboxMapsImpl = 'mapbox' <--- you need to add this
target 'your_project_name' do

@hamsterhomka
Copy link

hamsterhomka commented Dec 7, 2023

Same problem. Why Isn't the need to pass another parameter RNMapboxMapsImpl: 'mapbox' even mentioned in the guide for the expo plugin? And even after passing it I am still getting an error

import MapboxMaps
 ^ compiling for iOS 11.0, but module 'MapboxMaps' has a minimum deployment target of iOS 12.0: 
image I am using expo SDK 49 and my deploymentTarget is 13.0

Have u fixed an issue?

Yes, I did. You must pass this into expo plugin

[
    '@rnmapbox/maps',
    {
      RNMapboxMapsImpl: 'mapbox',
      RNMapboxMapsVersion: '10.16.2',
      RNMapboxMapsDownloadToken:
        'sk.your-key',
    },
],

It's extremely frustrating that this is not mentioned in the docs because typically you expect things to work right after pasting the example code. However, neither RNMapboxMapsImpl parameter nor the fact that RNMapboxMapsVersion: '11' doesn't work (at least with expo plugin) is mentioned. I was forced to spend several hours just to run a default example

@mfazekas
Copy link
Contributor

mfazekas commented Dec 8, 2023

So the issue is that #main documents the instructions with 10.1 which is only rc so you'd need to use expo install @rnmapbox/maps@next instead of expo install @rnmapbox/maps

This was fixed in the install instructions at:
https://rnmapbox.github.io/docs/install

And we're now just referring to it.
https://github.com/rnmapbox/maps#installation

@wvteijlingen
Copy link
Author

wvteijlingen commented Dec 20, 2023

@mfazekas I just created a new clean expo project and followed the instructions you linked. However, I'm now running into a different error:

iOS Bundling failed 621ms
error: App.tsx: Cannot find module '@rnmapbox/babel-plugin-maps'
Require stack:

  • /Users/x/node_modules/@babel/core/lib/config/files/plugins.js
  • /Users/x/node_modules/@babel/core/lib/config/files/index.js
  • /Users/x/node_modules/@babel/core/lib/index.js
  • /Users/x/node_modules/metro-transform-worker/src/index.js
  • /Users/x/node_modules/metro/src/DeltaBundler/Worker.flow.js
  • /Users/x/node_modules/metro/src/DeltaBundler/Worker.js
  • /Users/x/node_modules/jest-worker/build/workers/processChild.js
  • If you want to resolve "@rnmapbox/maps", use "module:@rnmapbox/maps"

@mfazekas
Copy link
Contributor

@wvteijlingen what is you config file? Do you have also added ... from the docs, it's not supposed to be added

@wvteijlingen
Copy link
Author

wvteijlingen commented Dec 21, 2023

I didn't add the ellipsis. Basically what I did is create a fresh Expo project using create-expo-app, and then added rnmapbox using the installation instructions.

// babel.config.js

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      [
        "@rnmapbox/maps",
        {
          "RNMapboxMapsDownloadToken": "<redacted>"
        }
      ]
    ]
  };
};
// package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@rnmapbox/maps": "^10.1.3",
    "expo": "~49.0.15",
    "expo-status-bar": "~1.6.0",
    "react": "18.2.0",
    "react-native": "0.72.6",
    "expo-splash-screen": "~0.20.5"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~18.2.14",
    "typescript": "^5.1.3"
  },
  "private": true
}
// App.tsx

import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { MapView } from "@rnmapbox/maps";

export default function App() {
  return (
    <View style={styles.container}>
      <Text>Open up App.tsx to start working on your app!</Text>
      <StatusBar style="auto" />
    </View>
  );
}

@mfazekas
Copy link
Contributor

I didn't add the ellipsis. Basically what I did is create a fresh Expo project using create-expo-app, and then added rnmapbox using the installation instructions.

Not exactly - the install instructions doesn't mention adding adding anything your babel.config.js.
https://rnmapbox.github.io/docs/install#plugin-configuration

@wvteijlingen
Copy link
Author

Aah you're right, I misread that, my mistake! I fixed it, but another issue pops up though:

ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

@mfazekas
Copy link
Contributor

Aah you're right, I misread that, my mistake! I fixed it, but another issue pops up though:

ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

See https://rnmapbox.github.io/docs/install?rebuild=expo#rebuild

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants