#Release version already exists error after bumping version number

1 messages Β· Page 1 of 1 (latest)

modern dune
#

HI there! I am unable to release a new version of my app. I am being blocked by Shorebird telling me a version already exists, but as you can see in the screenshot, I have already changed the version number and pushed it to my repo. The screenshot includes my repo's pubspec.yaml, my local pubspec.yaml, and my terminal error.

modern dune
#

This is only happening for iOS. The Android release worked fine

modern dune
#

I have run the command with the --verbose flag and it seems like the release is targeting the stable flavor instead of the specified internal flavor... any ideas why?

twin hinge
#

Can you share your shorebird.yaml?

kind juniper
#

Looks like the app_id is f098a04d-c372-4d8b-ab17-f096d55bcc18

#

I do see a release for iOS and Android for 1.4.1+31, but only an Android one for 1.4.1+32

#

I see, sorry, I failed to read the whole message. There is a suggesion that our flavor handling is wrong it sounds like?

modern dune
#

It could either be how we are handling the flavors or how it is handled by Shorebird during a release. This has never been an issue before, and I think it may have started occuring after the latest Shorebird upgrade... But there is also a chance that this issue is not related to flavors at all πŸ˜…

#

And it's weird that it is only happening for iOS...

jovial kite
#

Can you share the full commands you're running?

modern dune
#

Yes, it is: shorebird release ios --flavor internal. You can see it in the terminal of my first screenshot

#

In the second terminal screenshot, I added the --verbose option

jovial kite
#

I'm not sure I understand the issue. I'm seeing both iOS and Android releases for version 1.4.1+31 for the internal flavor (f098a04d-c372-4d8b-ab17-f096d55bcc18)

#

Which is in-line with the error message and logs you shared

modern dune
#

So the issue is that I am trying to create a new release for 1.4.1+32 (notice the updated build number). The command worked perfectly for android and there is now a new release for this. But when I try a new release for ios, it fails and it seems to be trying to create a release for the old version which already exists instead of a new version with the updated build number

jovial kite
#

Ah, so "seems like the release is targeting the stable flavor instead of the specified internal flavor" is not the issue. Got it

modern dune
#

Yes, I think I may have made the wrong conclusion there

jovial kite
#

First thing to check would be the info.plist in the xcarchive that the release builds

#

cat build/ios/archive/Runner.xcarchive/Info.plist from your project root will show what build numbers end up in the app

#

(these are what we read to determine release version)

#

The following would indicate version 1.0.1+63:

        <key>CFBundleShortVersionString</key>
        <string>1.0.1</string>
        <key>CFBundleVersion</key>
        <string>63</string>
modern dune
#

This is the output of that command

#

Would I need to adjust the command for my internal flavor?

jovial kite
#

If you want to build your internal flavor, yes. It would probably be a good idea to clear your build directory (rm -rf build) beforehand to make sure what you're seeing isn't stale

modern dune
#

Ok doing that now

jovial kite
#

(also, sharing text instead of screenshots is very much preferred)

modern dune
#

Oh sorry about that!

#

Will do

jovial kite
#

np, just makes things easier to search and copy/paste

#

Looks like that version was 1.4.0+5, which makes me think it's a stale version

#

Also was created a week ago, so +1 to the stale theory

modern dune
#

I believe this may be before we even had flavors set up

#

I've cleared the build directory. Do you suggest that I retry the release command?

jovial kite
#

Yep

modern dune
#

Ok trying now

#

So now it failed because it says that there is already a release with the new version πŸ˜… But for iOS there isn't one...

#

βœ“ Fetching apps (0.6s)
βœ“ Building ipa with Flutter 3.22.3 (5943e20af5) (224.6s)
βœ“ Fetching releases (0.7s)
A release with version 1.4.1+32 already exists but was built using a different Flutter revision.

Existing release built with: 3.22.3 (6aacc0c947)
Current release built with: 3.22.3 (5943e20af5)

All platforms for a given release must be built using the same Flutter revision.

To resolve this issue, you can:

  • Re-run the release command with "--flutter-version=3.22.3".
  • Delete the existing release and re-run the release command with the desired Flutter version.
  • Bump the release version and re-run the release command with the desired Flutter version.

If you aren't sure why this command failed, re-run with the --verbose flag to see more information.

#

Only one for Android

#

Ran the command for my Internal build:

gideonboshoff@Gideons-MacBook-Pro employee-app % cat "build/ios/archive/WorkWeek Internal.xcarchive/Info.plist"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ApplicationProperties</key>
<dict>
<key>ApplicationPath</key>
<string>Applications/WorkWeek Internal.app</string>
<key>Architectures</key>
<array>
<string>arm64</string>
</array>
<key>CFBundleIdentifier</key>
<string>africa.workweek.employee.internal</string>
<key>CFBundleShortVersionString</key>
<string>1.4.1</string>
<key>CFBundleVersion</key>
<string>32</string>
<key>SigningIdentity</key>
<string>Apple Development: Gideon Boshoff (AXFVJ365FA)</string>
<key>Team</key>
<string>RA76M97GD2</string>
</dict>
<key>ArchiveVersion</key>
<integer>2</integer>
<key>CreationDate</key>
<date>2024-07-24T15:45:33Z</date>
<key>Name</key>
<string>internal</string>
<key>SchemeName</key>
<string>internal</string>
</dict>

jovial kite
#

Ok so it looks like it's picking up the right version at least

#

I think I know whats going on with that other error. I'm at lunch now but I'll dig in when I'm back

modern dune
#

Ok no problem! Enjoy lunch! Our timezones are very different so I will be signing off for the evening and will have a look at your response in the morning πŸ‘

kind juniper
#

Thanks for the help Gideon!

jovial kite
#

Are you specifying a Flutter version in your command?

#

I think the issue is that we've changed the specific revision that 3.22.3 points to, and I'm not sure there's actually a way to resolve that πŸ€”

modern dune
#

I was not specifying the flutter version... is it possible for me to target a specific revision when I do a release?

#

I think maybe best would be for me to just do a new release on both Android and iOS and hopefully it will work. I can also do it via Codemagic to fix another issue I was having that I brought up in a different Discord thread

jovial kite
#

A new release will fix the issue. We have a fix coming that will allow you to specify a flutter revision (git hash) instead of a version so you can create an iOS release for the version above

modern dune
#

Just an update, I was able to create a new release from my terminal for iOS successfuly and it seems that it worked because there was not already an Android Shorebird release... It seems like my previous error was caused because Shorebird saw the Android release and then did not want to create an iOS release because it assumed there was a release out already. So, it seems that there is some mixing up of the iOS and Android releases

jovial kite
#

The error message you were seeing explains the issue (if somewhat confusingly):

A release with version 1.4.1+32 already exists but was built using a different Flutter revision.


  Existing release built with: 3.22.3 (6aacc0c947)
  Current release built with: 3.22.3 (5943e20af5)
#

Notice that the 3.22.3 versions have different hashes

#

We updated the version of Flutter that is considered 3.22.3 between when you created the android release and when you created tried to create the ios release

modern dune
#

Yes, but interestingly that second part of the error message only started appearing after I updgraded Shorebird and in my original error message at the start of this thread, the different hash numbers wasn't part of the issue

#

I tried the newly update Shorebird release earlier today and was met with the same error as my original error

jovial kite
#

I think you've hit a few different issues over the course of this thread

modern dune
#

Only by creating a new release with iOS first was I able to get past the original error

jovial kite
#

But ok, so we're back to the iOS build having a different version number than what you expect based on your pubspec?

modern dune
#

Yes, I am going to try and recreate the error now

#

I have been able to create an Android release successfully after the iOS release

#

So now I will try a new Android release and see if I can release iOS after that

#

This is what caused my original error

#

Everything seemed to work this time around! πŸ₯³ Been stuck on this for three days πŸ˜… I'm not sure what resolved it, but I no longer have issues getting releases out. Now I just have to sort out my releases via Codemagic since there is an error being thrown about CocoaPods's specs repository is too out-of-date to satisfy dependencies which is preventing a Shorebird iOS release on Codemagic... But I think that's something I need to bring up with Codemagic and their team

#

Thanks for all the input guys! 😁

jovial kite
#

You may just need to run pod install --repo-update before your build?

modern dune
#

I have tried that 😒

jovial kite
#

It succeeded and you still saw the error?

modern dune
#

It succeeded on my local terminal, but failed during the automatically triggered Codemagic build

jovial kite
#

Hmm, yeah, not sure what to tell you on that one