Flutter 不会编译我的应用程序的发布版本?

Flutter won't compile a release build of my app?

开发此应用程序后,我尝试使用 flutter run --release 命令将我的应用程序构建到 iOS。但是每当我这样做时,我都会收到此错误 *Could not build the precompiled application for the device.*

我试过 flutter clean 然后 flutter upgrade。我已经切换了 flutter 分支。我对这个很迷茫!

这是终端输出:

Building com.example.projectqr for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: HRCH36A6AR
Running pod install...                                             872ms
Running Xcode build...
Xcode build done.                                            3.7s
Failed to build iOS app
Error output from Xcode build:
↳
    objc[9606]: Class AppleTypeCRetimerRestoreInfoHelper is implemented in both /usr/lib/libauthinstall.dylib (0x1fde65eb0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1085f84f8).
    One of the two will be used. Which one is undefined.
    objc[9606]: Class AppleTypeCRetimerFirmwareAggregateRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x1fde65f00) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice
    (0x1085f8548). One of the two will be used. Which one is undefined.
    objc[9606]: Class AppleTypeCRetimerFirmwareRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x1fde65f50) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice
    (0x1085f8598). One of the two will be used. Which one is undefined.
    objc[9606]: Class ATCRTRestoreInfoFTABFile is implemented in both /usr/lib/libauthinstall.dylib (0x1fde65fa0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1085f85e8). One of
    the two will be used. Which one is undefined.
    objc[9606]: Class AppleTypeCRetimerFirmwareCopier is implemented in both /usr/lib/libauthinstall.dylib (0x1fde65ff0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1085f8638).
    One of the two will be used. Which one is undefined.
    objc[9606]: Class ATCRTRestoreInfoFTABSubfile is implemented in both /usr/lib/libauthinstall.dylib (0x1fde66040) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1085f8688). One of
    the two will be used. Which one is undefined.
    2022-04-26 18:57:12.964 xcodebuild[9606:80050] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in
    com.apple.dt.IDEWatchSupportCore
    2022-04-26 18:57:12.964 xcodebuild[9606:80050] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension
    Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    ** BUILD FAILED **


Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/4v/gxt19vmx267662mjsmfhf8mc0000gn/T/flutter_tools.WkwIsq/flutter_ios_build_temp_dirgZNqVy/temporary_xcresult_bundle


    Failed to package /Users/adamjackson/Documents/Github/projectQR/Flutter.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in dependency order

    Result bundle written to path:
        /var/folders/4v/gxt19vmx267662mjsmfhf8mc0000gn/T/flutter_tools.WkwIsq/flutter_ios_build_temp_dirgZNqVy/temporary_xcresult_bundle


Encountered error while building for device.

感谢观看!

1.执行

Flutter Clean

然后

  1. 从 Xcode 中删除模拟器并re-add 一个新的模拟器

然后

  1. Re-run 你的应用在 flutter 中,它将是

进一步的解决方案:

  • 打开 Xcode 中的 iOS 模块。

终于找到解决办法了!

最后的问题是 CocoaPod 没有正确安装。

在挖掘了一生的感觉之后!我再次安装 HomeBrew,然后使用 brew install cocoapods 命令重新安装 cocoapod。在那之后我 运行 flutter clean 然后用 flutter run 然后它签署了应用程序并在我的 iPhone!

上启动了它

感谢您提供想法并帮助我解决这个问题!