emcniece / cordova-plugin-rssi

Reports the WiFi RSSI for Android and iOS
MIT License
7 stars 3 forks source link

Error on cordova iOS compile #10

Open msudol opened 3 years ago

msudol commented 3 years ago

So, the latest 1.2.0 compiled for android, I finally got around to testing it for iOS and had a bug on compile...

cordova-plugin-rssi/RSSI.swift:107:73: error: value of type 'UIWindow' has no member 'windowScene'; did you mean 'windowLevel'?
                if let statusBarManager = UIApplication.shared.keyWindow?.windowScene?.statusBarManager,
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ~~~~~~~~~~~
                                                                          windowLevel
emcniece commented 3 years ago

Thanks for the report. Could you provide some more context for this device? Hardware, OS version, XCode version, Cordova version, etc. 🙏

msudol commented 3 years ago

No device, failed cloud compile with phonegap/cordova - still using phonegap build because haven't been able to full transition over to another service yet..

Cordova Settings:

PhoneGap (iOS / Android / Windows) cli-9.0.0 (5.0.1 / 8.0.0 / 7.0.0)

emcniece commented 3 years ago

This might be the thing that tips you toward a new build platform.

Best I can tell, this error happens when using a version of XCode (in particular, the xcodebuild binary) that doesn't have knowledge of iOS 13. There's a couple of issues (1, 2) that mention the need for XCode 11 or greater (I have 12 installed). Looks like the compiler isn't taking the platform-specific logic into account, despite the code in question being contained within an iOS 13 check.

Phonegap, being deprecated, may not have these latest versions of XCode available. I'm still hunting, but this is the only Phonegap build/cli changelog I can find so far: https://build.phonegap.com/changelog. It doesn't look completely up-to-date as it doesn't mention phonegap-cli 9.0... but it also doesn't mention any XCode versions past 10.

Is there any way to confirm the version of XCode that Phonegap is running?