Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ Checkout the example app in the [example](./example) folder.
- **`GMSServices must be configured before use`**
Ensure your key is in `Info.plist` and/or provided via `GMSServices.provideAPIKey(...)` in `AppDelegate.swift`.

- **Build fails with `Node.h` import error from SVGKit**
SVGKit uses a header `Node.h` which can conflict with iOS system headers.
You can patch it automatically in your **Podfile** inside the `post_install` hook:
- **Build fails with `Node.h`, `CSSValue.h`, or `SVGLength.h` import errors from SVGKit**
SVGKit includes headers (`Node.h`, `CSSValue.h`, `SVGLength.h`) that can conflict with
iOS system headers and React Native Reanimated’s internal types.
You can patch them automatically in your **Podfile** inside the `post_install`

```ruby
post_install do |installer|
Expand All @@ -121,14 +122,35 @@ Checkout the example app in the [example](./example) folder.
end
end

# Patch SVGKit includes to avoid Node.h conflicts
# --- SVGKit Patch ---
require 'fileutils'
svgkit_path = File.join(installer.sandbox.pod_dir('SVGKit'), 'Source')

# node fix
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
FileUtils.chmod("u+w", file)
text = File.read(file)
new_contents = text.gsub('#import "Node.h"', '#import "SVGKit/Node.h"')
File.open(file, 'w') { |f| f.write(new_contents) }
# puts "Patched Node import in: #{file}"
end

# import CSSValue.h
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
FileUtils.chmod("u+w", file)
text = File.read(file)
new_contents = text.gsub('#import "CSSValue.h"', '#import "SVGKit/CSSValue.h"')
File.open(file, 'w') { |f| f.write(new_contents) }
# puts "Patched CSSValue import in: #{file}"
end

# import SVGLength.h
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
FileUtils.chmod("u+w", file)
text = File.read(file)
new_contents = text.gsub('#import "SVGLength.h"', '#import "SVGKit/SVGLength.h"')
File.open(file, 'w') { |f| f.write(new_contents) }
# puts "Patched SVGLength import in: #{file}"
end
end
```
Expand Down
6 changes: 5 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ apply plugin: "kotlin-android"
apply from: '../nitrogen/generated/android/RNGoogleMapsPlus+autolinking.gradle'
apply from: "./fix-prefab.gradle"

apply plugin: "com.facebook.react"
if (rootProject.name != "rngooglemapsplus.example") {
apply plugin: "com.facebook.react"
} else {
println("\u001B[33m⚠️ Skipping React Native Gradle plugin in library (example build detected)\u001B[0m")
}

def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RNGoogleMapsPlus_" + name]).toInteger()
Expand Down
1 change: 1 addition & 0 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
signingConfigs {
debug {
Expand Down
1 change: 1 addition & 0 deletions example/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const root = path.resolve(__dirname, '..');
module.exports = getConfig(
{
presets: ['module:@react-native/babel-preset'],
plugins: ['react-native-worklets/plugin'],
},
{ root, pkg }
);
39 changes: 31 additions & 8 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,36 @@ target 'GoogleMapsPlusExample' do
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
end
end
require 'fileutils'
svgkit_path = File.join(installer.sandbox.pod_dir('SVGKit'), 'Source')
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
FileUtils.chmod("u+w", file)
text = File.read(file)
new_contents = text.gsub('#import "Node.h"', '#import "SVGKit/Node.h"')
File.open(file, 'w') { |f| f.write(new_contents) }
end

# --- SVGKit Patch ---
require 'fileutils'
svgkit_path = File.join(installer.sandbox.pod_dir('SVGKit'), 'Source')

# node fix
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
FileUtils.chmod("u+w", file)
text = File.read(file)
new_contents = text.gsub('#import "Node.h"', '#import "SVGKit/Node.h"')
File.open(file, 'w') { |f| f.write(new_contents) }
# puts "Patched Node import in: #{file}"
end

# import CSSValue.h
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
FileUtils.chmod("u+w", file)
text = File.read(file)
new_contents = text.gsub('#import "CSSValue.h"', '#import "SVGKit/CSSValue.h"')
File.open(file, 'w') { |f| f.write(new_contents) }
# puts "Patched CSSValue import in: #{file}"
end

# import SVGLength.h
Dir.glob(File.join(svgkit_path, '**', '*.{h,m}')).each do |file|
FileUtils.chmod("u+w", file)
text = File.read(file)
new_contents = text.gsub('#import "SVGLength.h"', '#import "SVGKit/SVGLength.h"')
File.open(file, 'w') { |f| f.write(new_contents) }
# puts "Patched SVGLength import in: #{file}"
end
end
end
Loading
Loading