Skip to content

Commit

Permalink
fix(ios): support for use_frameworks! :linkage => :static
Browse files Browse the repository at this point in the history
react-native-google-maps relies on headers from react-native-maps.
When using frameworks, headers from react-native-maps are no longer found, as the framework search
path for react-native-maps isn't added to the react-native-google-maps framework.

Likewise, removing the import prefix from Google-Maps-iOS-Utils resolves the imports
both with and without use_frameworks.

Note: this only brings support for `use_frameworks!` with `:linkage => :static.
  • Loading branch information
monholm committed Apr 18, 2023
1 parent dcbf3fb commit b0c2d42
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: bc8556d76f83a1a9075cdee207aad7c0b7b30a33
React-jsinspector: 5e5497c844f2381e8648ec3a7d0ad25b3f27f23e
React-logger: b277ad8f4473f2506fb30b762b6348534a3de10e
react-native-google-maps: d6b4795e0cea1fd5ee68f5f5f90e2c5cf32f90f2
react-native-google-maps: 67d5cceac64e7b85e619be3a61c9a11e45ebdae6
react-native-maps: 30d24060fb0abe9998d31a4cf37421ff14c59e25
React-perflogger: e9249a18e055cae96fdf685bf6145cbea62506c8
React-RCTActionSheet: a6d2a544a4605a111ce80fa9319cc870ca3ea778
Expand Down
8 changes: 4 additions & 4 deletions ios/AirGoogleMaps/AIRGoogleMap.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#import <objc/runtime.h>

#ifdef HAVE_GOOGLE_MAPS_UTILS
#import <Google-Maps-iOS-Utils/GMUKMLParser.h>
#import <Google-Maps-iOS-Utils/GMUPlacemark.h>
#import <Google-Maps-iOS-Utils/GMUPoint.h>
#import <Google-Maps-iOS-Utils/GMUGeometryRenderer.h>
#import "GMUKMLParser.h"
#import "GMUPlacemark.h"
#import "GMUPoint.h"
#import "GMUGeometryRenderer.h"
#define REQUIRES_GOOGLE_MAPS_UTILS(feature) do {} while (0)
#else
#define GMUKMLParser void
Expand Down
2 changes: 1 addition & 1 deletion ios/AirGoogleMaps/AIRGoogleMapHeatmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created by David Cako on 29 April 2018.
//

#import <Google-Maps-iOS-Utils/GMUHeatmapTileLayer.h>
#import "GMUHeatmapTileLayer.h"

@interface AIRGoogleMapHeatmap : UIView

Expand Down
3 changes: 2 additions & 1 deletion react-native-google-maps.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Pod::Spec.new do |s|

s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
s.source_files = "ios/AirGoogleMaps/**/*.{h,m}"
s.compiler_flags = '-DHAVE_GOOGLE_MAPS=1', '-DHAVE_GOOGLE_MAPS_UTILS=1', '-fno-modules'
s.compiler_flags = '-DHAVE_GOOGLE_MAPS=1', '-DHAVE_GOOGLE_MAPS_UTILS=1'
s.pod_target_xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"${PODS_CONFIGURATION_BUILD_DIR}/react-native-maps"' }

s.dependency 'React-Core'
s.dependency 'GoogleMaps', '7.3.0'
Expand Down

0 comments on commit b0c2d42

Please sign in to comment.