包缺少 Info.plist 或 CFBundlePackageType 不是“APPL”或“FMWK”。无法验证您的申请。 (-21017)

问题描述 投票:0回答:3

我正在尝试使用 Github Actions 为具有多个目标(每个环境一个:内部、客户端和零售)的应用程序将包上传到 Appstore。我收到这个错误:

*** 错误:上传“build/Products/IPA/myapp.ipa”时出错。 *** 错误:无法确定包的捆绑包 ID。包缺少 Info.plist 或 CFBundlePackageType 不是“APPL”或“FMWK”。无法验证您的申请。 (-21017) { NSLocalizedDescription = "无法确定包\U2019s 包 ID。包缺少 Info.plist 或 CFBundlePackageType 不是 \U2018APPL\U2019 或 \U2018FMWK\U2019。"; NSLocalizedFailureReason = "无法验证您的应用程序。"; }

我已经有了带有 APPL 的 CFBundlePackageType。我也尝试将其更改为 FMWK。 这是文件夹相应目标中我的 Info.plist 的内容:

<!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>

我正在使用这些命令来生成包:

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"

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>

感谢任何帮助。我已经为此苦苦挣扎了一段时间。我是这一切的新手,老实说不知道该怎么做。

github-actions bundle info.plist
3个回答
14
投票

当我的 MacBook 更新到 XCode 14 时,我遇到了同样的问题。Circle CI 使用相同的代码运行良好(XCode 13.4.1 + Fastlane)。

最后,在我删除解决方法后它再次起作用

ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true

查看更多: https://github.com/fastlane/fastlane/issues/20741#issuecomment-1306967243


1
投票

使用 Xcode14.2 和 fastlane2.212.1,

remove ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true
不起作用,因为
ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD
之前从未设置过。

但显式设置

ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=false
有效。(在Fastfile中,添加
ENV['ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD'] = 'false'
)见https://github.com/fastlane/fastlane/issues/20910


0
投票

Xcode14.1.0 和 fastlane2.212.1

ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=false

工作适合我

© www.soinside.com 2019 - 2024. All rights reserved.