You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For older systems kIOMainPortDefault is not available in scope during compile time and so it throws an error.
device_info_plus-9.1.2/macos/Classes/SystemUUID.swift:10:58: error: cannot find 'kIOMainPortDefault' in scope
platformExpert = IOServiceGetMatchingService(kIOMainPortDefault, dev).
If fixed that by changing runtime check to compile time check.
To recreate:
Try to compile package on older systems
To fix:
in Class:
/plus_plugins/packages/device_info_plus/device_info_plus/macos/Classes/SystemUUID.swift
Code Sample
To fix this issue:Replace:Runtime check
if #available(macOS 12, *) {
platformExpert =IOServiceGetMatchingService(kIOMainPortDefault, dev)
} else {
platformExpert =IOServiceGetMatchingService(kIOMasterPortDefault, dev)
}
With:CompileTime check.
#ifMACOS12_OR_LATERprint("Running on macOS 12 or newer")
platformExpert =IOServiceGetMatchingService(kIOMainPortDefault, dev)
#elseprint("Running on an older version of macOS")
platformExpert =IOServiceGetMatchingService(kIOMasterPortDefault, dev)
#endif
Logs
fix available above.
Flutter Doctor
fix available above.
Checklist before submitting a bug
I searched issues in this repository and couldn't find such bug/problem
I Google'd a solution and I couldn't find it
I searched on StackOverflow for a solution and I couldn't find it
I read the README.md file of the plugin
I'm using the latest version of the plugin
All dependencies are up to date with flutter pub upgrade
I did a flutter clean
I tried running the example project
The text was updated successfully, but these errors were encountered:
Platform
Mac os 10
Plugin
device_info_plus
Version
9.1.2
Flutter SDK
3.0.0
Steps to reproduce
For older systems kIOMainPortDefault is not available in scope during compile time and so it throws an error.
device_info_plus-9.1.2/macos/Classes/SystemUUID.swift:10:58: error: cannot find 'kIOMainPortDefault' in scope
platformExpert = IOServiceGetMatchingService(kIOMainPortDefault, dev).
If fixed that by changing runtime check to compile time check.
To recreate:
To fix:
in Class:
/plus_plugins/packages/device_info_plus/device_info_plus/macos/Classes/SystemUUID.swift
Code Sample
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean
The text was updated successfully, but these errors were encountered: