Skip to content

[Bug]: IOS - shows duplicated version number when the build number is not specified #1644

@AlexLomm

Description

@AlexLomm

Platform

iOS 16.3.1

Plugin

package_info_plus

Version

3.0.3

Flutter SDK

3.7.6

Steps to reproduce

  1. Open pubspec.yaml of an app
  2. Specify a version without the + suffix. Example: 1.0.1
  3. Log somewhere the output of the fromPlatform():
print((await PackageInfo.fromPlatform()).buildNumber); // -> output: 1.0.1
  1. Build and run the app

Expected:
An empty string is logged, because the build number is not specified in the pubspec.yaml

Actual
1.0.1 is logged

Code Sample

print((await PackageInfo.fromPlatform()).buildNumber); // -> output: 1.0.1

Logs

N/A

Flutter Doctor

flutter doctor -v
[✓] Flutter (Channel stable, 3.7.6, on macOS 13.2.1 22D68 darwin-arm64, locale en-US)
    • Flutter version 3.7.6 on channel stable at /Users/alex/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 12cb4eb7a0 (4 weeks ago), 2023-03-01 10:29:26 -0800
    • Engine revision ada363ee93
    • Dart version 2.19.3
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/alex/Library/Android/sdk
    • Platform android-31, build-tools 31.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 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.76.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • Alex’s iPhone (mobile)     • 00008110-001168D4227B801E            • ios            • iOS 16.3.1 20D67
    • iPhone 14 Pro Max (mobile) • 55A79A4B-7C45-4379-AA2F-079B01624D05 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 13.2.1 22D68 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 111.0.5563.110
    ! Error: (null) needs to connect to determine its availability. Check the connection between the device and its
      companion iPhone, and the connection between the iPhone and Xcode. Both devices may also need to be restarted and
      unlocked. (code 1)
    ! Error: To use iPad for development, enable Developer Mode in Settings → Privacy & Security.  (code 6)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!


### Checklist before submitting a bug

- [X] I Google'd a solution and I couldn't find it
- [X] I searched on StackOverflow for a solution and I couldn't find it
- [X] I read the README.md file of the plugin
- [X] I'm using the latest version of the plugin
- [X] All dependencies are up to date with `flutter pub upgrade`
- [X] I did a `flutter clean`
- [X] I tried running the example project

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions