NordicSemiconductor / IOS-nRF-Connect-Device-Manager

A mobile management library for devices supporting nRF Connect Device Manager.
https://www.nordicsemi.com/Software-and-tools/Software/nRF-Connect-SDK
Apache License 2.0
90 stars 41 forks source link

Variable binding in a condition requires an initializer #87

Closed RickGroenewegen closed 1 year ago

RickGroenewegen commented 1 year ago

Since 1.2.8 a piece of code has been added in McuMgrBleTransport+CBPeripheralDelegate that has been throwing errors. The project cannot be build because of it:

Line 131 : Variable binding in a condition requires an initializer

if let previousUpdateNotificationSequenceNumber,

Only option currently is to roll back to <=1.2.7

jazzychad commented 1 year ago

This is using the new swift syntax for optional unwrapping assignment.. but yes it fails builds for older Xcode/swift versions.. I think I will open a PR with a fix b/c I don't really want to maintain my fork just for this 1 line for much longer :(

jazzychad commented 1 year ago

made a PR here: https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager/pull/98

zhxf2012 commented 1 year ago

Please release a new tag support the older Xcode/swift versions by fixing Variable binding in a condition requires an initializer. Now only option currently is to roll back to <=1.2.7 ,Need new version support XCode 13.x.

dinesharjani commented 1 year ago

So far there aren't enough bug fixes to warrant a full release, I think. Instead, you can pull the library pointing to master / main branch. That should fix the issue for you. If not, let me know.

zhxf2012 commented 1 year ago

I use this framework in my ota sdk which support cocoapods. Unfortunately I get error below when try to use master:

Analyzing dependencies [!] Failed to load 'BPBleOTA' podspec: [!] Invalid BPBleOTA.podspec file: [!] Podspecs cannot specify the source of dependencies. The :git option is not supported. :git can be used in the Podfile instead to override global dependencies..

from /Volumes/Data/iOSBBB/BPBleOTA/BPBleOTA.podspec:48

 s.dependency 'iOSDFULibrary', '~> 4.13.0'
s.dependency 'iOSMcuManagerLibrary' ,:git => 'https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager.git'

end

It seems podspec of cocoapods dosn't support pointing to this master.

Roll back to <=1.2.7 can work but with an bug leading to ota failed, in my case device skip reset and report completed,but actualy not. Using another mac with new Xcode and latest iOSMcuManagerLibrary it works fine.

Still hope latest version support Xcode 13.x for a period,since some of my sdk users will still use Xcode 13.x for a long time.

dinesharjani commented 1 year ago

Closing for now. Please feel free to reopen if needed.