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

[Bug]: App does not build when using use_frameworks! in v11 #3137

Closed
balloman opened this issue Oct 26, 2023 · 3 comments
Closed

[Bug]: App does not build when using use_frameworks! in v11 #3137

balloman opened this issue Oct 26, 2023 · 3 comments

Comments

@balloman
Copy link
Contributor

Mapbox Implementation

Mapbox

Mapbox Version

11.0.0-beta.5

Platform

iOS

@rnmapbox/maps version

10.1.0-beta.14

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

When building the application on iOS, the error


  15 | @end
  16 | 
> 17 | #import <rnmapbox_maps-Swift.h>
     |         ^ 'rnmapbox_maps-Swift.h' file not found
  18 | 
  19 | 
  20 | @implementation RNMBXShapeSourceModule

is generated by RNMBShapeSourceModule.mm

Expected behavior

There is no error.

Notes / preliminary analysis

This can be fixed by using the same method that was applied in rnmapbox_maps-Swift.pre.h, so modifying the import to check if use frameworks is being used like so:

#if RNMBX_USE_FRAMEWORKS
#import <rnmapbox_maps/rnmapbox_maps-Swift.h>
#else
#import <rnmapbox_maps-Swift.h>
#endif

Additional links and references

No response

@mfazekas
Copy link
Contributor

@balloman thanks yep, there were new #import <rnmapbox_maps ... added those should be replace with #import "rnmapbox_maps-Swift.pre.h"

@mfazekas
Copy link
Contributor

Should be fixed by: #3138

@herbertvuijk
Copy link

Add
$RNMapboxMapsUseFrameworks = true
to your POD file if you use_frameworks, just below:
$RNMapboxMapsImpl = 'mapbox'

Then run pod install and try again.

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

No branches or pull requests

3 participants