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

gfr*_*coa 13 bundle info.plist github-actions

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

\n

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

\n

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

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

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

\n
cd ios\n\n    BUILD_NUMBER=$(date +%Y%m%d%H%M)\n    xcrun agvtool new-version -all ${BUILD_NUMBER}\n\n    # creates an .xarchive file\n    xcodebuild -workspace myapp.xcworkspace \\\n        -scheme myappinternal clean archive -configuration Internal \\\n        -archivePath ./build/Products/myapp.xcarchive \\\n\n    # converts the .xarchive file to .ipa by including the provisioning profile\n    xcodebuild -exportArchive \\\n        -archivePath ./build/Products/myapp.xcarchive \\\n        -exportPath ./build/Products/IPA/myapp.ipa \\\n        -exportOptionsPlist exportOptionsInternal.plist\n\n    # upload the .ipa to Apple Connect\n    xcrun altool --upload-app --type ios --file ./build/Products/IPA/myapp.ipa \\\n        --username "$IOS_APP_STORE_CONNECT_USERNAME" --password "$IOS_APP_STORE_CONNECT_PASSWORD"\n
Run Code Online (Sandbox Code Playgroud)\n

exportOptionsInternal.plist 的内容

\n
<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n    <key>method</key>\n    <string>app-store</string>\n    <key>provisioningProfiles</key>\n    <dict>\n        <key>com.myapp.internal</key>\n        <string>Github_Actions_Myapp_Internal</string>\n    </dict>\n</dict>\n</plist>\n
Run Code Online (Sandbox Code Playgroud)\n

我很感激任何帮助。我已经为此苦苦挣扎了一段时间。我对这一切都很陌生,老实说我不知道​​该怎么做。

\n

小智 16

当我的 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