Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flutter_tools] flutter build ios: Some keys in Info.plist (of extension services) are ignored #66900

Closed
yanivshaked opened this issue Sep 29, 2020 · 10 comments
Labels
a: build Building flutter applications with the tool a: release Challenges faced when attempting to productionize an app platform-ios iOS applications specifically

Comments

@yanivshaked
Copy link

The following key-value pairs are defined in the Info.plist file of both Notification Service and Share extension of my application:

        <key>CFBundleName</key>
        <string>$(PRODUCT_NAME)</string>
        <key>CFBundleShortVersionString</key>
        <string>$(FLUTTER_BUILD_NAME)</string>
        <key>CFBundleVersion</key>
        <string>$(FLUTTER_BUILD_NUMBER)</string>

The build completes OK, but fails when trying to upload to the App Store with the following error messages:
(either with fastlane or manual upload with Xcode organizer)

[12:31:16]: [Transporter Error Output]: ERROR ITMS-90057: "The bundle 'Payload/Runner.app/PlugIns/NotificationService.appex' is missing plist key. The Info.plist file is missing the required key: CFBundleShortVersionString. Please find more information about CFBundleShortVersionString at https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring"
[12:31:16]: [Transporter Error Output]: ERROR ITMS-90056: "This bundle Payload/Runner.app/PlugIns/NotificationService.appex is invalid. The Info.plist file is missing the required key: CFBundleVersion. Please find more information about CFBundleVersion at https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion"
[12:31:16]: [Transporter Error Output]: ERROR ITMS-90057: "The bundle 'Payload/Runner.app/PlugIns/Share Extension.appex' is missing plist key. The Info.plist file is missing the required key: CFBundleShortVersionString. Please find more information about CFBundleShortVersionString at https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring"
[12:31:16]: [Transporter Error Output]: ERROR ITMS-90056: "This bundle Payload/Runner.app/PlugIns/Share Extension.appex is invalid. The Info.plist file is missing the required key: CFBundleVersion. Please find more information about CFBundleVersion at https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion"
[12:31:16]: [Transporter Error Output]: ERROR ITMS-90360: "Missing Info.plist value. A value for the key 'CFBundleVersion' in bundle Runner.app/PlugIns/NotificationService.appex is required."
[12:31:16]: [Transporter Error Output]: ERROR ITMS-90360: "Missing Info.plist value. A value for the key 'CFBundleShortVersionString' in bundle Runner.app/PlugIns/NotificationService.appex is required."
[12:31:16]: [Transporter Error Output]: ERROR ITMS-90360: "Missing Info.plist value. A value for the key 'CFBundleVersion' in bundle Runner.app/PlugIns/Share Extension.appex is required."
[12:31:16]: [Transporter Error Output]: ERROR ITMS-90360: "Missing Info.plist value. A value for the key 'CFBundleShortVersionString' in bundle Runner.app/PlugIns/Share Extension.appex is required."
[12:31:16]: [Transporter Error Output]: ERROR ITMS-90360: "Missing Info.plist value. A value for the key 'CFBundleName' in bundle Runner.app/PlugIns/Share Extension.appex is required."
[12:31:16]: Transporter transfer failed.

When replacing the values of those keys with their final value (for example: replace $(FLUTTER_BUILD_NUMBER) with 682), the upload to App Store is successful.

This was working with version 1.7.15, I have just updated to the latest stable release (1.20.4).
Flutter doctor output:


Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.7 19H2, locale en-IL)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
      You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
[!] Android Studio (not installed)
[✓] VS Code (version 1.47.2)
[✓] Connected device (1 available)

@yanivshaked yanivshaked added the team-infra Owned by Infrastructure team label Sep 29, 2020
@pedromassangocode pedromassangocode added a: build Building flutter applications with the tool platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels. a: release Challenges faced when attempting to productionize an app in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds and removed team-infra Owned by Infrastructure team a: build Building flutter applications with the tool a: release Challenges faced when attempting to productionize an app platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels. labels Sep 29, 2020
@pedromassangocode
Copy link

Hi @yanivshaked
Can you please provide your flutter doctor -v?
Thank you

@yanivshaked
Copy link
Author

Sure, sorry for not providing it before:

[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.7 19H2, locale en-IL)
    • Flutter version 1.20.4 at /Users/buildmachine/Development/flutter
    • Framework revision fba99f6cf9 (2 weeks ago), 2020-09-14 15:32:52 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
      You may also want to add it to your PATH environment variable.


[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.47.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.12.2

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 29, 2020
@pedromassangocode pedromassangocode added a: build Building flutter applications with the tool a: release Challenges faced when attempting to productionize an app t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels. platform-ios iOS applications specifically and removed in triage Presently being triaged by the triage team labels Sep 30, 2020
@tp
Copy link

tp commented Oct 6, 2020

Running into the same issue where flutter run does not work anymore, failing with this error (likewise pointing to the FLUTTER_BUILD_NUMBER variable not being set for the CFBundleVersion value).

2020-10-06 10:38:52.321 ios-deploy[84330:1097552] [ !! ] Error 0xe800009c: The bundle's Info.plist does not contain a CFBundleVersion key or its value is not a string. AMDeviceSecureInstallApplication(0, device, url, options, install_callback, 0)
Could not run build/ios/iphoneos/Runner.app on 602e35529a525cd7ec5b93257d9b1781b20770bd.
Try launching Xcode and selecting "Product > Run" to fix the problem: 

My assumption is there is an issue with the Podfile (which needed some upgrade), but not sure yet.

@jmagman
Copy link
Member

jmagman commented Oct 12, 2020

@yanivshaked If you need to use Flutter build settings values, then your extension targets need to inherit from the Debug.xcconfig and Release.xcconfig configuration files, which import Generated.xcconfig generated from your pubspec (and other places).

Screen Shot 2020-10-12 at 1 18 33 PM

Will keep this open as a request for documentation.

@jmagman jmagman added documentation and removed t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels. labels Oct 12, 2020
@yanivshaked
Copy link
Author

@yanivshaked If you need to use Flutter build settings values, then your extension targets need to inherit from the Debug.xcconfig and Release.xcconfig configuration files, which import Generated.xcconfig generated from your pubspec (and other places).

Screen Shot 2020-10-12 at 1 18 33 PM

Will keep this open as a request for documentation.

I tried it, but the issue persists.

@jmagman
Copy link
Member

jmagman commented Nov 5, 2020

CFBundleVersion is set to FLUTTER_BUILD_NUMBER and that should be set in that configuration file (Debug.xconfig for example). Is it not in there?

Can we get the output of flutter run -v (it's large, so you'll need to attach it) so I can see what Xcode has for your build setting?

@jmagman jmagman added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 5, 2020
@yanivshaked
Copy link
Author

The configuration file has FLUTTER_BUILD_NUMBER defined.
I will produce the output of flutter run -v and attach it shortly.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 8, 2020
@yanivshaked yanivshaked reopened this Nov 8, 2020
@yanivshaked
Copy link
Author

Sorry, I accidently closed the issue.

@pedromassangocode pedromassangocode added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 9, 2020
@pedromassangocode
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact description of what happens, logs, and the output of flutter doctor -v.
All system setups can be slightly different, so it's always better to open new issues and reference related issues.

@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 2, 2020
@github-actions
Copy link

github-actions bot commented Aug 9, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: build Building flutter applications with the tool a: release Challenges faced when attempting to productionize an app platform-ios iOS applications specifically
Projects
None yet
Development

No branches or pull requests

5 participants