The package is missing an Info.plist or the CFBundlePackageType is not ‘APPL’ or ‘FMWK’. Unable to validate your application. (-21017)
Asked Answered
B

5

13

I'm trying to upload bundle to Appstore with Github Actions for an app with multiple targets (one per environment: internal, client and retail). I'm getting this error:

*** Error: Error uploading 'build/Products/IPA/myapp.ipa'. *** Error: Could not determine the package’s bundle ID. The package is missing an Info.plist or the CFBundlePackageType is not ‘APPL’ or ‘FMWK’. Unable to validate your application. (-21017) { NSLocalizedDescription = "Could not determine the package\U2019s bundle ID. The package is missing an Info.plist or the CFBundlePackageType is not \U2018APPL\U2019 or \U2018FMWK\U2019."; NSLocalizedFailureReason = "Unable to validate your application."; }

I already have CFBundlePackageType with APPL. I also tried changing it to FMWK. This is the content of my Info.plist inside the folder's corresponding target:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(MARKETING_VERSION)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>com.myapp.internal</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.myapp.internal</string>
            </array>
        </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>$(CURRENT_PROJECT_VERSION)</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>localhost</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>
    <key>NSAppleMusicUsageDescription</key>
    <string>$(PRODUCT_NAME) would like to use Apple Music</string>
    <key>NSCameraUsageDescription</key>
    <string>$(PRODUCT_NAME) would like to use your camera for modifying your avatar picture.</string>
    <key>NSFaceIDUsageDescription</key>
    <string>Allow $(PRODUCT_NAME) to use FaceID</string>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>$(PRODUCT_NAME) would like to use location</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>$(PRODUCT_NAME) would like to use location</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>$(PRODUCT_NAME) would like to use location</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>$(PRODUCT_NAME) would like to use your microphone</string>
    <key>NSPhotoLibraryAddUsageDescription</key>
    <string>$(PRODUCT_NAME) would like to save photos to your photo gallery</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>$(PRODUCT_NAME) would like access to your photo gallery for uploading your avatar picture.</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>fetch</string>
        <string>location</string>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>SplashScreen</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleDefault</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
</dict>
</plist>

And I'm using these commands to generate the bundle:

cd ios

    BUILD_NUMBER=$(date +%Y%m%d%H%M)
    xcrun agvtool new-version -all ${BUILD_NUMBER}

    # creates an .xarchive file
    xcodebuild -workspace myapp.xcworkspace \
        -scheme myappinternal clean archive -configuration Internal \
        -archivePath ./build/Products/myapp.xcarchive \

    # converts the .xarchive file to .ipa by including the provisioning profile
    xcodebuild -exportArchive \
        -archivePath ./build/Products/myapp.xcarchive \
        -exportPath ./build/Products/IPA/myapp.ipa \
        -exportOptionsPlist exportOptionsInternal.plist

    # upload the .ipa to Apple Connect
    xcrun altool --upload-app --type ios --file ./build/Products/IPA/myapp.ipa \
        --username "$IOS_APP_STORE_CONNECT_USERNAME" --password "$IOS_APP_STORE_CONNECT_PASSWORD"

The content of the exportOptionsInternal.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>method</key>
    <string>app-store</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>com.myapp.internal</key>
        <string>Github_Actions_Myapp_Internal</string>
    </dict>
</dict>
</plist>

I appreciate any help. I've been struggling with this for a while. I'm new to all of this and honestly don't know what to do.

Burka answered 5/8, 2022 at 3:43 Comment(2)
Same issue herePotation
Same issue here, also with Github actions. Do you also use fastlane by any chance?Philologian
V
16

I had the same problem when my MacBook updated to XCode 14. Circle CI worked well (XCode 13.4.1 + Fastlane) with the same code.

Finally, it worked again after I removed the workaround ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true

See more: https://github.com/fastlane/fastlane/issues/20741#issuecomment-1306967243

Viperish answered 12/12, 2022 at 6:59 Comment(0)
G
2

Using Xcode14.2 and fastlane2.212.1, remove ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true does not work as ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD has never been set before.

But explicitly set ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=false works.(In Fastfile,add ENV['ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD'] = 'false') See https://github.com/fastlane/fastlane/issues/20910

Ginn answered 4/4, 2023 at 6:6 Comment(1)
This helped us resolve this use when using Ionic Appflow to build out cordova application. Thanks!Satin
A
1

Original poster did not mention fastlane, and all the answers are related to fastlane. So for anyone who is experiencing this problem, while not using fastlane (using command line interface), the problem in the original question is with the second command:

    xcodebuild -exportArchive \
        -archivePath ./build/Products/myapp.xcarchive \
        -exportPath ./build/Products/IPA/myapp.ipa \ <--- THIS IS THE PROBLEM
        -exportOptionsPlist exportOptionsInternal.plist

The export path should not include the name of the IPA file. The name of the ipa file will be automatically generated from the $(PRODUCT_NAME). So if you specify ./build/Products/IPA/myapp.ipa, the IPA will actually be something like ./build/Products/IPA/myapp.ipa/My App.ipa

Instead, provide the -exportPath ./build/Products/IPA.

And in xcrun altool ensure that you are referring to a correct name of the IPA. It may not be ./build/Products/IPA/myapp.ipa as you expect, but ./build/Products/IPA/My App.ipa.

Analisaanalise answered 31/8, 2023 at 0:56 Comment(0)
C
0

This is how I created my ipa file without fastlane, just terminal:

xcodebuild -workspace $PWD/ios/Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/ios/iphoneos/Runner.xcarchive
xcodebuild -exportArchive -archivePath $PWD/build/ios/iphoneos/Runner.xcarchive -exportOptionsPlist $PWD/ios/exportOptions.plist -exportPath $PWD/build/ios/iphoneos/IPA

and this is how i uploaded it:

xcrun altool --upload-app -f ./build/ios/iphoneos/IPA/myapp.ipa -t ios -u [email protected] -p kccx-hytm-adsf-asdf 

the {product_name}.ipa file -f gets generated by the first command. The name depends on the given product_name. The passwort -p is the application-specific password that can be generated in the apple developer portal.

Alternatively can the Transporter App be used to upload the app.

Castrato answered 29/12, 2023 at 4:33 Comment(0)
J
-1

Xcode14.1.0 and fastlane2.212.1

ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=false

work's for me

Jollify answered 2/5, 2023 at 10:41 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.