ffmpeg-kit icon indicating copy to clipboard operation
ffmpeg-kit copied to clipboard

Apple distribution failed error when using LTS variant

Open LeGoffMael opened this issue 3 years ago • 7 comments

Description I am using ffmpeg_kit 4.5.1-LTS in one of my Flutter plugin.

ffmpeg_kit_flutter_min_gpl: 4.5.1-LTS

Everything worked fine until i wanted to upload my app to TestFlight. After building the app and archived the package, the upload fail at the end with the error that you can see in the screenshot section.

I think that in your file scripts/function-apple.sh you are automatically adding CFBundleVersion and CFBundleShortVersionString.

Looking at App Store Connect error you should remove the variant keyword (here .LTS) from the generated Info.plist.

If i am not using LTS variant it works fine.

Expected behavior I should be able to upload my archive to TestFlight using 4.5.1-LTS.

Current behavior Upload fails.

To Reproduce You could try to upload the example app to TestFlight, using 4.5.1-LTS.

Screenshots Screen Shot 2022-01-17 at 12 31 33 PM

Environment

  • Platform: Flutter
  • Architecture: Mac mini M1
  • Version: v4.5.1.LTS
  • Source branch: main
  • Xcode version: 12.5.1
  • Cocoapods version: 1.11.2

LeGoffMael avatar Jan 17 '22 03:01 LeGoffMael

I replaced manually Info.plist file in ios/Pods/ffmpeg-kit-ios-min-gpl/ffmpegkit.framework with:

  <key>CFBundleShortVersionString</key>
  <string>4.5.1</string>
  <key>CFBundleVersion</key>
  <string>4.5.1</string>

And i've been able to upload my app to TestFlight.

Would a patched for 4.5.1 be possible ? Or could you suggest a more efficient way to solve this issue ?

LeGoffMael avatar Jan 17 '22 08:01 LeGoffMael

I marked this as a bug since the values we set for those two keys don't conform to the format detailed by Apple.

We tested v4.5.1 on Xcode 13.2.1 and didn't see the issue there. I suggest upgrading your Xcode version if you can.

If that is not an option then you can use a post_install hook in your Podfile to delete the .LTS part from the version. This thread CocoaPods/CocoaPods/issues/4421 has a few examples. I haven't tried them but they should do the job.

We have two workarounds. Therefore, I don't think a patch is necessary.

tanersener avatar Jan 18 '22 00:01 tanersener

Ok thank you for those information. I will try both workarounds and let you know.

LeGoffMael avatar Jan 18 '22 01:01 LeGoffMael

I confirm that using Xcode 13+ version there is no issue, thank you

LeGoffMael avatar Jan 21 '22 02:01 LeGoffMael

Running into this issue as well, our CI did not manage to deploy using Xcode 13.3 (Build version 13E113) on macOS 12.2 (Monterey).

adigladi avatar Mar 29 '22 10:03 adigladi

@adigladi See my comment above. There are workarounds you can try to unblock your CI.

tanersener avatar Apr 02 '22 13:04 tanersener

Adding this to my Podfile did the trick

post_install do |installer| 
  plist_buddy = "/usr/libexec/PlistBuddy"
  plist = "Pods/ffmpeg-kit-ios-min-gpl/ffmpegkit.framework/Info.plist"
  original_version = `#{plist_buddy} -c "Print CFBundleVersion" "#{plist}"`.strip
  changed_version = original_version[/(\d+\.){1,2}(\d+)?/]
  unless original_version == changed_version
      puts "Fix version of Pod ffmpeg-kit-ios-min-gpl: #{original_version} => #{changed_version}"
      `#{plist_buddy} -c "Set CFBundleVersion #{changed_version}" "Pods/ffmpeg-kit-ios-min-gpl/ffmpegkit.framework/Info.plist"`
  end
  original_short_version = `#{plist_buddy} -c "Print CFBundleShortVersionString" "#{plist}"`.strip
  changed_short_version = original_short_version[/(\d+\.){1,2}(\d+)?/]
  unless original_short_version == changed_short_version
      puts "Fix version of Pod ffmpeg-kit-ios-min-gpl: #{original_short_version} => #{changed_short_version}"
      `#{plist_buddy} -c "Set CFBundleShortVersionString #{changed_short_version}" "Pods/ffmpeg-kit-ios-min-gpl/ffmpegkit.framework/Info.plist"`
  end
end

gabrieldonadel avatar May 06 '22 17:05 gabrieldonadel