iosflutterxcodeflutter-ios-build

iOS Build Failure After Adding device_info_plus: ^9.1.1 Dependency


After adding the device_info_plus: ^9.1.1 dependency to my Flutter project, I encountered an error while attempting to build the iOS app. The build fails with the following error in Xcode.

Failed to build iOS app

Error (Xcode): ../../.pub-cache/hosted/pub.dev/win32-4.1.4/lib/src/guid.dart:31:9: Error: Type 'UnmodifiableUint8ListView' not found.

flutter doctor output:
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
• Flutter version 3.24.0 on channel stable at /Users/mobasher/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 80c2e84975 (2 weeks ago), 2024-07-30 23:06:49 +0700
• Engine revision b8800d88be
• Dart version 3.5.0
• DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/mobasher/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2

I tried to run

flutter pub upgrade win32

and

flutter pub cache clean
flutter channel stable
flutter pub get
flutter pub upgrade

Solution

  • Finally I found a solution by adding this package win32: ^5.0.0