Xcode 构建失败未显示相关错误消息

Mth*_*iba 13 xcode ios flutter

我试图在 iOS 上从 Flutter 构建一个应用程序,但是当我尝试运行构建时,我收到以下错误:初始化失败后无效重用。这就是我在错误消息方面得到的全部信息。我尝试在网上查找,但没有找到任何相关内容。我想我的 info.plist 可能有问题,但我找不到任何错误。下面是 info.plist 的内容

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENTLANGUAGE)</string>
   <key>CFBundleExecutable</key>
   <string>$(EXECUTABLENAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCTBUNDLEIDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>synthexklutchrelease</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTERBUILDNAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTERBUILDNUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSPhotoLibraryUsageDescription</key>
<string>App needs access to photo lib for profile images</string>
<key>NSCameraUsageDescription</key>
<string>To capture profile photo please grant camera access</string>
</dict>
</plist>
Run Code Online (Sandbox Code Playgroud)

小智 59

清理构建文件夹 ( Cmd+Shift+K) 帮助我解决了初始化失败后的无效重用问题

  • 这应该是公认的答案 (2认同)

Dan*_*oek 42

刚刚遇到了同样的问题。我通过双击文件概述中的 Runner 修复了它。这在右侧显示了身份和类型。如果您将项目格式(在项目文档下)设置为 Xcode 12.0-compatible,它就可以工作。

希望描述有帮助。我只在为 iOS 测试 Flutter 构建时使用 mac,所以我不是专家:p