From dae82c60b3d682acb1c381b8fdd707a1423a9337 Mon Sep 17 00:00:00 2001 From: Ryan Thomas Date: Mon, 8 Jul 2019 15:51:45 -0500 Subject: [PATCH 1/2] fix: use_native_modules! displays a descriptive warning and then skips any dependency packages without a podspec (#506) --- packages/platform-ios/native_modules.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/platform-ios/native_modules.rb b/packages/platform-ios/native_modules.rb index d0c91b60d..55e28def5 100644 --- a/packages/platform-ios/native_modules.rb +++ b/packages/platform-ios/native_modules.rb @@ -27,6 +27,17 @@ def use_native_modules!(root = "..", packages = nil) next unless package_config = package["platforms"]["ios"] podspec_path = package_config["podspecPath"] + + # Add a warning to the queue and continue to the next dependency if the podspec_path is nil/empty + if podspec_path.nil? || podspec_path.empty? + Pod::UI.warn("use_native_modules! skipped the react-native dependency '#{package["name"]}'. No podspec file was found.", + [ + "Check to see if there is an updated version that contains the necessary podspec file", + "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" + ]) + end + next if podspec_path.nil? || podspec_path.empty? + spec = Pod::Specification.from_file(podspec_path) # We want to do a look up inside the current CocoaPods target From 465af306ea70d3ad49c0e09e302644ef1bd6aa6c Mon Sep 17 00:00:00 2001 From: Ryan Thomas Date: Mon, 8 Jul 2019 16:13:35 -0500 Subject: [PATCH 2/2] fix: use_native_modules! includes a suggested action to disable autolinking and link the dependency manually. (#506) --- packages/platform-ios/native_modules.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/platform-ios/native_modules.rb b/packages/platform-ios/native_modules.rb index 55e28def5..20a60df8d 100644 --- a/packages/platform-ios/native_modules.rb +++ b/packages/platform-ios/native_modules.rb @@ -33,7 +33,8 @@ def use_native_modules!(root = "..", packages = nil) Pod::UI.warn("use_native_modules! skipped the react-native dependency '#{package["name"]}'. No podspec file was found.", [ "Check to see if there is an updated version that contains the necessary podspec file", - "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" + "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", + "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" ]) end next if podspec_path.nil? || podspec_path.empty?