ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.24k stars 955 forks source link

[Bug]: #7427

Closed jakubjenis closed 3 weeks ago

jakubjenis commented 3 weeks ago

Capacitor Version

Latest Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0

Installed Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/ios: 6.0.0 @capacitor/android: 6.0.0

Other API Details

npm --version
10.5.0

node --version
v21.7.3

pod --version
1.15.2

Platforms Affected

Current Behavior

After upgrading from Capacitor v5 to v6 and running npx cap sync I am getting a build error on ios:

...@capacitor/ios/Capacitor/Capacitor/Codable/JSValueEncoder.swift:103:5 Missing return in getter expected to return 'String'

It seems the JSValueEncoder is missing the default return here: https://github.com/ionic-team/capacitor/blob/5b2ab7c68db4e77b8b2961e927acc5a708ee260f/ios/Capacitor/Capacitor/Codable/JSValueEncoder.swift#L101

Expected Behavior

iOS builds without error

Project Reproduction

none

Additional Information

No response

Steven0351 commented 3 weeks ago

What version of Xcode are you using? Switch statements as expressions were introduced in Swift 5.9 which is shipped in Xcode 15 which Capacitor now requires

jakubjenis commented 3 weeks ago

You are absolutely right, I was on XCode 14. Updating to 15 fixes the problem. Thanks!