marcuswestin / WebViewJavascriptBridge

An iOS/OSX bridge for sending messages between Obj-C and JavaScript in UIWebViews/WebViews
http://marcuswest.in
MIT License
14.29k stars 2.98k forks source link

Installed with CocoaPods in Xcode 15 beta 6 can not build module 'WebKit' #430

Open Tmac90301 opened 1 year ago

Tmac90301 commented 1 year ago

When installed this pod with CocoaPods in Xcode 15 beta 6, can not pass build with error " Could not build module 'WebKit' ".

While drag files into project directly works well.

It seems like the WebKit new APIs for iOS 17 cannot be correctly linked.

#if ((TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED >= 140000) \
    || ((TARGET_OS_IOS || TARGET_OS_MACCATALYST) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000) \
    || (TARGET_OS_WATCH && __WATCH_OS_VERSION_MAX_ALLOWED >= 100000) \
    || (TARGET_OS_TV && __TV_OS_VERSION_MAX_ALLOWED >= 170000))
/*! @abstract Gets or sets the proxy configurations to be used to override networking in all WKWebViews that use this WKWebsiteDataStore.
 @discussion Changing the proxy configurations might interupt current networking operations in any WKWebView that use this WKWebsiteDataStore,
 so it is encouraged to finish setting the proxy configurations before starting any page loads.
*/
@property (nullable, nonatomic, copy) NSArray<nw_proxy_config_t> *proxyConfigurations NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.0), ios(17.0));
#endif

The type nw_proxy_config_t declared in Network.framework cannot be found correctly in WebKit header file WKWebsiteDataStore.h

I have tried add dependency of Network.framework for pod target in Build Phase, but still not working.

Is there anyone meets the same error and solved this?

dizz commented 1 year ago

Have the same issue here 🙁

LeonardoYanJun commented 1 year ago

Have the same issue here 🙁

morris322 commented 1 year ago

Update iOS version to greater than 5 in podspec and pod install again can fix this issue. Ex: s.platforms = { :ios => "11.0", :osx => "" }

yyks999 commented 1 year ago

Try this

open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h, change __IPHONE_OS_VERSION_MAX_ALLOWED to 180000

sigmassimo commented 1 year ago

to @yyks999, this file does not exists(on my Mac). And I´ve got the current error that I can't download cocoa pods: "ERROR: Failed to build gem native extension." I´ve got the macOS Release Candidate, I had to uninstall cocoa pods and now I can not download it anymore.

Could anyone help me?

KhamHti commented 1 year ago

Try this

open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h, change __IPHONE_OS_VERSION_MAX_ALLOWED to 180000

how can I edit that file with? I tried with Xcode but I can't edit it.

cHAuHaN-AppyHigh commented 1 year ago

@KhamHti sudo nano /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h

Use arrow keys to navigate and change the value of __IPHONE_OS_VERSION_MAX_ALLOWED to 180000 and hit Ctrl + O -> hit Enter/Return -> hit Ctrl + X -> hit Enter/Return

cederache commented 11 months ago

@KhamHti sudo nano /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h

Use arrow keys to navigate and change the value of __IPHONE_OS_VERSION_MAX_ALLOWED to 180000 and hit Ctrl + O -> hit Enter/Return -> hit Ctrl + X -> hit Enter/Return

[EDIT] I managed to do it directly in the finder. I had to duplicate the file, modify it, then drag it in the Headers folder and enter my admin password

[ORIGINAL ANSWER] I tried it but it seems that I do not have the permission to modify this file : [ Cannot open file for writing: Operation not permitted ]

I tried to add write access to file without success with a sudo chmod u+w

misuqian commented 9 months ago

改成源代码集成,而不是CocoaPods。或者把podspec里面的依赖版本提高一下。 Change to source code integration, not CocoaPods. Or improve the podspec inside the dependent version.