Skip to content

Commit cbb9828

Browse files
RyanThomas73thymikee
authored andcommitted
fix: use_native_modules! warns and skips dependencies without a podspec (#507)
1 parent c9aec25 commit cbb9828

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/platform-ios/native_modules.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ def use_native_modules!(root = "..", packages = nil)
2727
next unless package_config = package["platforms"]["ios"]
2828

2929
podspec_path = package_config["podspecPath"]
30+
31+
# Add a warning to the queue and continue to the next dependency if the podspec_path is nil/empty
32+
if podspec_path.nil? || podspec_path.empty?
33+
Pod::UI.warn("use_native_modules! skipped the react-native dependency '#{package["name"]}'. No podspec file was found.",
34+
[
35+
"Check to see if there is an updated version that contains the necessary podspec file",
36+
"Contact the library maintainers or send them a PR to add a podspec. The react-native-webview podspec is a good example of a package.json driven podspec. See https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec",
37+
"If necessary, you can disable autolinking for the dependency and link it manually. See https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library"
38+
])
39+
end
40+
next if podspec_path.nil? || podspec_path.empty?
41+
3042
spec = Pod::Specification.from_file(podspec_path)
3143

3244
# We want to do a look up inside the current CocoaPods target

0 commit comments

Comments
 (0)