Search code examples
fluttercocoapods

Flutter version on IOS stuck at 1.0.0


When I run:

pod outdated

on IOS to determine any pods that are outdated I get the following result:

.... 

Analyzing dependencies
The color indicates what happens when you run `pod update`
<green>  - Will be updated to the newest version
<blue>   - Will be updated, but not to the newest version because of specified version in Podfile
<red>    - Will not be updated because of specified version in Podfile

The following pod updates are available:
- Flutter 1.0.0 -> 1.0.0 (latest version 1.3.300)
- Protobuf 3.9.2 -> 3.9.2 (latest version 3.10.0-rc1)

While version 1.0.0 of Flutter (in red) seems to be okay at the moment on IOS can someone please suggest how I can update this Pod?

I have upgraded Flutter using:

/Users/bob/Downloads/flutter/bin/flutter upgrade

The above command seems to make no difference per the pod version noted above. I would prefer everything be at the latest version but if it is not necessary knowing that information would be helpful as well.

Using:

/Users/bob/Downloads/flutter/bin/flutter doctor -v

reveals:

[✓] Flutter (Channel stable, v1.9.1+hotfix.2, on Mac OS X 10.14.6 18G95, locale en-US)
    • Flutter version 1.9.1+hotfix.2 at /Users/bob/Downloads/flutter
    • Framework revision 2d2a1ffec9 (3 weeks ago), 2019-09-06 18:39:49 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/bob/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.0, Build version 11A420a
    • CocoaPods version 1.6.0

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available)
    • iPhone 11 Pro Max • 08EB7508-34DE-4797-8F33-3DEE671742E4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-0 (simulator)

• No issues found!

Solution

  • The problem comes from the podhelper.rb script (YOUR_PATH//flutter/packages/flutter_tools/bin/podhelper.rb). It generates a 'fake' Flutter.podspec file but it hardcodes the 1.0.0 podspec.

    Resolve this by editing lines 155-190 of podspec.rb (for iOS app), replacing the json definitions for the podspec with the version you want to move to from the CocoaPods repo (e.g. here for v2.5). Run pod update and it will update to 2.5.

    The next section in the script repeats the same error for macOS apps so you may need to repeat for lines 193-228.