diff --git a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md index 403c760d267..219e1031bca 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_wkwebview/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.23.7 + +* Adds $(inherited) to xcconfig search paths to fix linker errors on Xcode 26. + ## 3.23.6 * Fixes a crash if WebViewFlutterWKWebViewExternalAPI is passed the wrong registry. diff --git a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec index dc1753ebc92..b9b773b752f 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec +++ b/packages/webview_flutter/webview_flutter_wkwebview/darwin/webview_flutter_wkwebview.podspec @@ -23,8 +23,8 @@ Downloaded by pub (not CocoaPods). s.resource_bundles = {'webview_flutter_wkwebview_privacy' => ['webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/Resources/PrivacyInfo.xcprivacy']} s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.xcconfig = { - 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', - 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', + 'LIBRARY_SEARCH_PATHS' => '$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', + 'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) /usr/lib/swift', } s.swift_version = '5.0' end diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index 9678b60179c..5439ee7a5fb 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_wkwebview description: A Flutter plugin that provides a WebView widget based on Apple's WKWebView control. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_wkwebview issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 3.23.6 +version: 3.23.7 environment: sdk: ^3.9.0 diff --git a/script/tool/lib/src/podspec_check_command.dart b/script/tool/lib/src/podspec_check_command.dart index 24f0d80f346..b3549e3a1ab 100644 --- a/script/tool/lib/src/podspec_check_command.dart +++ b/script/tool/lib/src/podspec_check_command.dart @@ -80,8 +80,8 @@ class PodspecCheckCommand extends PackageLoopingCommand { if (_isPodspecMissingSearchPaths(podspec)) { const workaroundBlock = r''' s.xcconfig = { - 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', - 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', + 'LIBRARY_SEARCH_PATHS' => '$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', + 'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) /usr/lib/swift', } '''; final String path = getRelativePosixPath( @@ -209,10 +209,12 @@ class PodspecCheckCommand extends PackageLoopingCommand { // This errs on the side of being too strict, to minimize the chance of // accidental incorrect configuration. If we ever need more flexibility // due to a false negative we can adjust this as necessary. + // The $(inherited) prefix is optional but recommended to preserve any + // search paths that Xcode or CocoaPods may generate. final workaround = RegExp(r''' \s*s\.(?:ios\.)?xcconfig = {[^}]* -\s*'LIBRARY_SEARCH_PATHS' => '\$\(TOOLCHAIN_DIR\)/usr/lib/swift/\$\(PLATFORM_NAME\)/ \$\(SDKROOT\)/usr/lib/swift', -\s*'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift',[^}]* +\s*'LIBRARY_SEARCH_PATHS' => '(?:\$\(inherited\) )?\$\(TOOLCHAIN_DIR\)/usr/lib/swift/\$\(PLATFORM_NAME\)/ \$\(SDKROOT\)/usr/lib/swift', +\s*'LD_RUNPATH_SEARCH_PATHS' => '(?:\$\(inherited\) )?/usr/lib/swift',[^}]* \s*}''', dotAll: true); return !workaround.hasMatch(podspec.readAsStringSync()); } diff --git a/script/tool/test/podspec_check_command_test.dart b/script/tool/test/podspec_check_command_test.dart index dbd7fe9b276..abf1f735ce9 100644 --- a/script/tool/test/podspec_check_command_test.dart +++ b/script/tool/test/podspec_check_command_test.dart @@ -33,8 +33,8 @@ void _writeFakePodspec( final swiftWorkaround = includeSwiftWorkaround ? ''' s.${scopeSwiftWorkaround ? 'ios.' : ''}xcconfig = { - 'LIBRARY_SEARCH_PATHS' => '\$(TOOLCHAIN_DIR)/usr/lib/swift/\$(PLATFORM_NAME)/ \$(SDKROOT)/usr/lib/swift', - 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', + 'LIBRARY_SEARCH_PATHS' => '\$(inherited) \$(TOOLCHAIN_DIR)/usr/lib/swift/\$(PLATFORM_NAME)/ \$(SDKROOT)/usr/lib/swift', + 'LD_RUNPATH_SEARCH_PATHS' => '\$(inherited) /usr/lib/swift', } ''' : ''; @@ -288,8 +288,8 @@ void main() { containsAllInOrder([ contains(r''' s.xcconfig = { - 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', - 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', + 'LIBRARY_SEARCH_PATHS' => '$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', + 'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) /usr/lib/swift', }'''), contains('The following packages had errors:'), contains( @@ -327,8 +327,8 @@ void main() { containsAllInOrder([ contains(r''' s.xcconfig = { - 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', - 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', + 'LIBRARY_SEARCH_PATHS' => '$(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', + 'LD_RUNPATH_SEARCH_PATHS' => '$(inherited) /usr/lib/swift', }'''), contains('The following packages had errors:'), contains(