uni-app IOS打包失败报错

发布于 1周前 作者 caililin 来自 Uni-App

uni-app IOS打包失败报错

操作步骤

  • 更换APP启动页面后重新打包

预期结果

  • 打包成功

实际结果

  • 打包失败报错

bug描述

CompileStoryboard [PackagePath]/HBuilder/Base.lproj/LaunchScreen.storyboard (in target ‘HBuilder’ from project ‘HBuilder’) cd [PackagePath] /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --companion-strings-file en:[PackagePath]/HBuilder/en.lproj/LaunchScreen.strings --companion-strings-file zh-Hans:[PackagePath]/HBuilder/zh-Hans.lproj/LaunchScreen.strings --module HBuilder --output-partial-info-plist /Users/[Name]/Library/Developer/Xcode/DerivedData/HBuilder-fckdhaaiymoltffcqvbvfufchshc/Build/Intermediates.noindex/ArchiveIntermediates/HBuilder/IntermediateBuildFilesPath/HBuilder.build/Release-iphoneos/HBuilder.build/Base.lproj/LaunchScreen-SBPartialInfo.plist --auto-activate-custom-fonts --target-device iphone --minimum-deployment-target 12.0 --output-format human-readable-text --compilation-directory /Users/[Name]/Library/Developer/Xcode/DerivedData/HBuilder-fckdhaaiymoltffcqvbvfufchshc/Build/Intermediates.noindex/ArchiveIntermediates/HBuilder/IntermediateBuildFilesPath/HBuilder.build/Release-iphoneos/HBuilder.build/Base.lproj [PackagePath]/HBuilder/Base.lproj/LaunchScreen.storyboard /* com.apple.ibtool.errors */ [PackagePath]/HBuilder/Base.lproj/LaunchScreen.storyboard: error: Line 19: Specification mandates value for attribute View Line 19: attributes construct error Line 19: Couldn’t find end of Start Tag imageCompileAssetCatalog /Users/[Name]/Library/Developer/Xcode/DerivedData/HBuilder-fckdhaaiymoltffcqvbvfufchshc/Build/Intermediates.noindex/ArchiveIntermediates/HBuilder/InstallationBuildProductsLocation/Applications/HBuilder.app [PackagePath]/HBuilder/Assets.xcassets (in target ‘HBuilder’ from project ‘HBuilder’) cd [PackagePath] /Applications/Xcode.app/Contents/Developer/usr/bin/actool --output-format human-readable-text --notices --warnings --export-dependency-info /Users/[Name]/Library/Developer/Xcode/DerivedData/HBuilder-fckdhaaiymoltffcqvbvfufchshc/Build/Intermediates.noindex/ArchiveIntermediates/HBuilder/IntermediateBuildFilesPath/HBuilder.build/Release-iphoneos/HBuilder.build/assetcatalog_dependencies --output-partial-info-plist /Users/[Name]/Library/Developer/Xcode/DerivedData/HBuilder-fckdhaaiymoltffcqvbvfufchshc/Build/Intermediates.noindex/ArchiveIntermediates/HBuilder/IntermediateBuildFilesPath/HBuilder.build/Release-iphoneos/HBuilder.build/assetcatalog_generated_info.plist --app-icon AppIcon --compress-pngs --enable-on-demand-resources YES --development-region en --target-device iphone --minimum-deployment-target 12.0 --platform iphoneos --compile /Users/[Name]/Library/Developer/Xcode/DerivedData/HBuilder-fckdhaaiymoltffcqvbvfufchshc/Build/Intermediates.noindex/ArchiveIntermediates/HBuilder/InstallationBuildProductsLocation/Applications/HBuilder.app [PackagePath]/HBuilder/Assets.xcassets

warning: Run script build phase ‘Run Script’ will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking “Based on dependency analysis” in the script phase. (in target ‘HBuilder’ from project ‘HBuilder’) — xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00008112-001408E93AA3401E, name:My Mac } { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } … { platform:iOS Simulator, id:A5028598-3FC6-46E7-AFCE-7CEC9713E217, OS:17.5, name:iPhone 15 Pro Max } { platform:iOS Simulator, id:A5028598-3FC6-46E7-AFCE-7CEC9713E217, OS:17.5, name:iPhone 15 Pro Max } { platform:iOS Simulator, id:7DDCD2C3-00A2-4EC6-98B3-83D31A938CAD, OS:17.2, name:iPhone SE (3rd generation) } { platform:iOS Simulator, id:7DDCD2C3-00A2-4EC6-98B3-83D31A938CAD, OS:17.2, name:iPhone SE (3rd generation) } { platform:iOS Simulator, id:FF00A80D-30A7-411B-A8D7-06087A911FA1, OS:17.5, name:iPhone SE (3rd generation) } { platform:iOS Simulator, id:FF00A80D-30A7-411B-A8D7-06087A911FA1, OS:17.5, name:iPhone SE (3rd generation) } ARCHIVE FAILED The following build commands failed: CompileStoryboard [PackagePath]/HBuilder/Base.lproj/LaunchScreen.storyboard (in target ‘HBuilder’ from project ‘HBuilder’) (1 failure)


2 回复

重复问题,问题原因查看https://ask.dcloud.net.cn/question/201129


在处理uni-app打包iOS应用时遇到报错问题,首先需要确定具体的错误信息,因为不同的错误可能有不同的解决方案。不过,我可以提供一些常见的排查步骤和示例代码片段,帮助你定位和解决打包失败的问题。

1. 检查Xcode和uni-app-cli版本

确保你的Xcode和uni-app-cli都是最新版本,因为旧版本可能不兼容最新的iOS SDK或uni-app框架。

# 更新uni-app-cli
npm install -g @dcloudio/uni-app-cli

2. 检查manifest.json配置

确保manifest.json中的app-plus配置正确无误,特别是与iOS相关的配置,如app-plus.distribute.apple部分。

"app-plus": {
    "distribute": {
        "apple": {
            // iOS相关配置
            "appid": "你的Apple ID",
            "teamId": "你的Team ID"
        }
    }
}

3. 清理和重建项目

有时候,清理项目并重新构建可以解决一些奇怪的打包问题。

# 清理项目
cd /path/to/your/uni-app-project
npm run clean

# 重新构建
npm run dev:%PLATFORM%  # %PLATFORM% 替换为 ios

4. 检查原生插件和模块

如果你使用了原生插件或模块,确保它们兼容iOS平台,并且已经正确集成。

5. 查看Xcode日志

直接在Xcode中打开生成的.xcworkspace文件,尝试构建项目,并查看Xcode的控制台输出以获取更详细的错误信息。

6. 示例:处理证书问题

如果错误与证书相关,确保你的开发者证书、Provisioning Profile等配置正确。以下是一个在manifest.json中配置证书的示例:

"app-plus": {
    "distribute": {
        "apple": {
            "certPassword": "你的证书密码", // 如果证书需要密码
            "p12": "path/to/your/cert.p12", // 证书路径
            "mobileprovision": "path/to/your/profile.mobileprovision" // Provisioning Profile路径
        }
    }
}

结论

由于你没有提供具体的错误信息,上述内容提供了一些通用的排查步骤和配置示例。如果问题依然存在,建议查看Xcode的详细构建日志,找到具体的错误代码或描述,然后根据错误信息进行针对性的解决。希望这些信息对你有所帮助!

回到顶部