question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not compatible with Expo 44

See original GitHub issue

Describe the bug
Fails to build with Expo 44. This lib is mostly (hitting lots of the known Android bugs) working nicely for us with Expo 43, but after upgrading to Expo 44 the build fails

The following build commands failed:
› Compiling @react-native-mapbox-gl/maps Pods/react-native-mapbox-gl » RCTMGLPointAnnotationManager.m
› Compiling @react-native-mapbox-gl/maps Pods/react-native-mapbox-gl » RCTMGLPointAnnotation.m

❌  (node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLPointAnnotation.m:36:16)

  34 |         self.calloutView.representedObject = self;
  35 |     } else {
> 36 |         [super insertReactSubview:subview atIndex:0];
     |                ^ no visible @interface for 'MGLAnnotationView' declares the selector 'insertReactSubview:atIndex:'
  37 |     }
  38 | }
  39 | 

❌  (node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLPointAnnotation.m:45:16)

  43 |         self.calloutView = nil;
  44 |     } else {
> 45 |         [super removeReactSubview:subview];
     |                ^ no visible @interface for 'MGLAnnotationView' declares the selector 'removeReactSubview:'
  46 |     }
  47 | }
  48 | 

❌  (node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLPointAnnotation.m:54:12)

  52 |         [_map removeAnnotation:self];
  53 |     }
> 54 |     [super reactSetFrame:frame];
     |            ^ no visible @interface for 'MGLAnnotationView' declares the selector 'reactSetFrame:'
  55 |     [self _setCenterOffset:frame];
  56 |     [self _addAnnotation];
  57 | }

❌  (node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLPointAnnotation.m:130:14)

  128 | - (MGLAnnotationView *)getAnnotationView
  129 | {
> 130 |     if (self.reactSubviews.count == 0) {
      |              ^ property 'reactSubviews' not found on object of type 'RCTMGLPointAnnotation *'
  131 |         // default pin view
  132 |         return nil;
  133 |     } else {

To Reproduce

  1. create new managed expo project
  2. follow install steps for react-native-mapbox-gl (https://github.com/react-native-mapbox-gl/maps/pull/1388#issuecomment-945917121)
  3. attempt to build app

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
mhammerccommented, Dec 27, 2021

My PR #1672 fixes the original issue, at least in non-managed projects that use expo.

Your error message about undefined method expo_patch_react_imports!'is something different.expo_patch_react_imports` was introduced very recently (I think expo 44.0.1) as an attempt to avoid patching native dependencies individually: expo/expo#15622 (comment)

Since you get undefined method in the Podfile, there is something else wrong that is not related to @react-native-mapbox-gl. Could be some expo version mismatch?

It works for me!

Bare react-native project but with some expo modules.

For anyone being in the same situation: here is the patch file for patch-package to be c/c. The patch is from the answer above from @schiller-manuel.

The patch file
diff --git a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLCallout.m b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLCallout.m
index c6c5e13..5e995c6 100644
--- a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLCallout.m
+++ b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLCallout.m
@@ -7,7 +7,7 @@
 //
 
 #import "RCTMGLCallout.h"
-#import "UIView+React.h"
+#import <React/UIView+React.h>
 
 @implementation RCTMGLCallout
 {
diff --git a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLImages.m b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLImages.m
index d0d4202..2738d0e 100644
--- a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLImages.m
+++ b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLImages.m
@@ -1,5 +1,5 @@
 #import "RCTMGLImages.h"
-#import "UIView+React.h"
+#import <React/UIView+React.h>
 #import "RCTMGLMapView.h"
 #import "RCTMGLUtils.h"
 #import "RCTMGLEvent.h"
diff --git a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLMapView.m b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLMapView.m
index 1ff1867..b439cc7 100644
--- a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLMapView.m
+++ b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLMapView.m
@@ -11,7 +11,7 @@
 #import "RCTMGLUtils.h"
 #import "RNMBImageUtils.h"
 #import "RCTMGLImages.h"
-#import "UIView+React.h"
+#import <React/UIView+React.h>
 #import "RCTMGLNativeUserLocation.h"
 #import "RCTMGLLogging.h"
 
diff --git a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLPointAnnotation.m b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLPointAnnotation.m
index 2a7f1a0..57621c3 100644
--- a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLPointAnnotation.m
+++ b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLPointAnnotation.m
@@ -9,7 +9,7 @@
 #import "RCTMGLPointAnnotation.h"
 #import "RCTMGLMapTouchEvent.h"
 #import "RCTMGLUtils.h"
-#import "UIView+React.h"
+#import <React/UIView+React.h>
 
 const float CENTER_X_OFFSET_BASE = -0.5f;
 const float CENTER_Y_OFFSET_BASE = -0.5f;
diff --git a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLSource.m b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLSource.m
index 9886602..fa2e7ee 100644
--- a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLSource.m
+++ b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLSource.m
@@ -7,7 +7,7 @@
 //
 
 #import "RCTMGLSource.h"
-#import "UIView+React.h"
+#import <React/UIView+React.h>
 #import "RCTMGLMapView.h"
 #import <React/RCTLog.h>
 
diff --git a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLSymbolLayer.m b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLSymbolLayer.m
index 5c7df30..475cb45 100644
--- a/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLSymbolLayer.m
+++ b/node_modules/@react-native-mapbox-gl/maps/ios/RCTMGL/RCTMGLSymbolLayer.m
@@ -8,7 +8,7 @@
 
 #import "RCTMGLSymbolLayer.h"
 #import "RCTMGLStyle.h"
-#import "UIView+React.h"
+#import <React/UIView+React.h>
 #import <React/RCTLog.h>
 
 @implementation RCTMGLSymbolLayer

2reactions
mfazekascommented, Mar 9, 2022

Should be fixed by #1672

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo SDK 44. Today we're announcing the release of…
SDK 44 includes React Native 0.64.3. ... (which is currently not compatible with react-native-reanimated ) or remove expo-updates to opt-out of updates.
Read more >
[ SDK 44 ] Can't open app in expo go when update to ... - GitHub
Exception: Incompatible SDK version ". I test it on a iOS simulator still can't open. I've use eas build -p android to build...
Read more >
Update Expo SDK from 44 to 45, 46 or 47 not working
I tryed several times to update the SDK Version in my project from 44 to 45,46 and 47. Each time I try to...
Read more >
expo-updates - npm
Start using expo-updates in your project by running `npm i expo-updates`. There are 109 other projects in the npm registry using expo-updates.
Read more >
Install in Expo project - NativeBase
Expo helps you to create universal (iOS, Android and Web) React Native apps with no build configuration. New Project. Existing Project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found