【问题标题】:Can't launch flutter app on my iphone because of flutter_ios_build_temp_dirZZL8EG/temporary_xcresult_bundle?由于flutter_ios_build_temp_dirZZL8EG/temporary_xcresult_bundle,无法在我的iphone上启动flutter应用程序?
【发布时间】:2022-08-19 14:41:32
【问题描述】:

我有一个可以在我的 PC 上运行的应用程序,但是当我尝试使用相同的代码在我的 Mac 上运行时,我遇到了停止运行的错误。

Error output from Xcode build:
↳
    2022-07-03 23:09:28.039 xcodebuild[54309:270223]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-18108/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
    Details:  (null) deviceType from 00008030-000448183438802E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7f957ae1c710>
    Method:   -platform
    Thread:   <NSThread: 0x7f957a9fcf80>{number = 6, name = (null)}
    Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
    2022-07-03 23:09:28.311 xcodebuild[54309:270230]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-18108/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
    Details:  (null) deviceType from 00008030-000448183438802E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7f957ae1c710>
    Method:   -platform
    Thread:   <NSThread: 0x7f9579005b50>{number = 3, name = (null)}
    Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
    2022-07-03 23:09:28.406 xcodebuild[54309:270230]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/DVTiOSFrameworks/DVTiOSFrameworks-18108/DTDeviceKitBase/DTDKRemoteDeviceData.m:371
    Details:  (null) deviceType from 00008030-000448183438802E was NULL when -platform called.
    Object:   <DTDKMobileDeviceToken: 0x7f957ae1c710>
    Method:   -platform
    Thread:   <NSThread: 0x7f9579005b50>{number = 3, name = (null)}
    Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
    ** BUILD FAILED **


Xcode\'s output:
↳
    Writing result bundle at path:
        /var/folders/19/zvrhzg415_b51k3jvc_vz1mr0000gn/T/flutter_tools.L5V1RD/flutter_ios_build_temp_dirZZL8EG/temporary_xcresult_bundle

    ../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/percent_indicator-4.2.1/lib/linear_percent_indicator.dart:162:5: Warning: The class \'WidgetsBinding\' cannot be null.
    Try replacing \'?.\' with \'.\'
        WidgetsBinding?.instance.addPostFrameCallback((_) {
        ^^^^^^^^^^^^^^
    ../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/percent_indicator-4.2.1/lib/linear_percent_indicator.dart:162:30: Error: Method \'addPostFrameCallback\' cannot be called on \'WidgetsBinding?\' because it is potentially null.
     - \'WidgetsBinding\' is from \'package:flutter/src/widgets/binding.dart\' (\'../../Developer/flutter/packages/flutter/lib/src/widgets/binding.dart\').
    Try calling using ?. instead.
        WidgetsBinding?.instance.addPostFrameCallback((_) {
                                 ^^^^^^^^^^^^^^^^^^^^
    Failed to package /Users/XXXXX/AndroidStudioProjects/XXXX.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete

    Result bundle written to path:
        /var/folders/19/zvrhzg415_b51k3jvc_vz1mr0000gn/T/flutter_tools.L5V1RD/flutter_ios_build_temp_dirZZL8EG/temporary_xcresult_bundle


Could not build the precompiled application for the device.

Error launching application on iPhone.

颤振酒吧缓存清理后,我有一些新问题

Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode\'s output:
↳
    Writing result bundle at path:
        /var/folders/19/zvrhzg415_b51k3jvc_vz1mr0000gn/T/flutter_tools.lzkxYb/flutter_ios_build_temp_dir6KlO8j/temporary_xcresult_bundle

    /Users/quentinguichot/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/sensors_plus-1.3.2/ios/Classes/FLTSensorsPlusPlugin.m:45:24: warning: this old-style function definition is not preceded by a prototype [-Wstrict-prototypes]
    void _initMotionManager() {
                           ^
    1 warning generated.
    /Users/quentinguichot/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/sensors_plus-1.3.2/ios/Classes/FLTSensorsPlusPlugin.m:45:24: warning: this old-style function definition is not preceded by a prototype [-Wstrict-prototypes]
    void _initMotionManager() {
                           ^
    1 warning generated.
    In file included from /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.cc:43:
    /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/util/set_util.h:36:11: warning: parameter \'before\' not found in the function declaration [-Wdocumentation]
     * @param before - The elements that exist in the original set.
              ^~~~~~
    /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/util/set_util.h:37:11: warning: parameter \'after\' not found in the function declaration [-Wdocumentation]
     * @param after - The elements to diff against the original set.
              ^~~~~
    2 warnings generated.
    /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm:343:20: warning: implicit conversion loses integer precision: \'NSInteger\' (aka \'long\') to \'int\' [-Wshorten-64-to-32]
        max_attempts = options.maxAttempts;
                     ~ ^~~~~~~~~~~~~~~~~~~
    1 warning generated.
    In file included from /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.cc:43:
    /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/util/set_util.h:36:11: warning: parameter \'before\' not found in the function declaration [-Wdocumentation]
     * @param before - The elements that exist in the original set.
              ^~~~~~
    /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/util/set_util.h:37:11: warning: parameter \'after\' not found in the function declaration [-Wdocumentation]
     * @param after - The elements to diff against the original set.
              ^~~~~
    2 warnings generated.
    /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm:343:20: warning: implicit conversion loses integer precision: \'NSInteger\' (aka \'long\') to \'int\' [-Wshorten-64-to-32]
        max_attempts = options.maxAttempts;
                     ~ ^~~~~~~~~~~~~~~~~~~
    1 warning generated.
    In file included from /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.cc:43:
    /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/util/set_util.h:36:11: warning: parameter \'before\' not found in the function declaration [-Wdocumentation]
     * @param before - The elements that exist in the original set.
              ^~~~~~
    /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3/ios/Pods/FirebaseFirestore/Firestore/core/src/util/set_util.h:37:11: warning: parameter \'after\' not found in the function declaration [-Wdocumentation]
     * @param after - The elements to diff against the original set.
              ^~~~~
    2 warnings generated.
    ../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/percent_indicator-4.2.1/lib/linear_percent_indicator.dart:162:5: Warning: The class \'WidgetsBinding\' cannot be null.
    Try replacing \'?.\' with \'.\'
        WidgetsBinding?.instance.addPostFrameCallback((_) {
        ^^^^^^^^^^^^^^
    ../../Developer/flutter/.pub-cache/hosted/pub.dartlang.org/percent_indicator-4.2.1/lib/linear_percent_indicator.dart:162:30: Error: Method \'addPostFrameCallback\' cannot be called on \'WidgetsBinding?\' because it is potentially null.
     - \'WidgetsBinding\' is from \'package:flutter/src/widgets/binding.dart\' (\'../../Developer/flutter/packages/flutter/lib/src/widgets/binding.dart\').
    Try calling using ?. instead.
        WidgetsBinding?.instance.addPostFrameCallback((_) {
                                 ^^^^^^^^^^^^^^^^^^^^
    Failed to package /Users/quentinguichot/AndroidStudioProjects/ouiquit_v3.
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete

    Result bundle written to path:
        /var/folders/19/zvrhzg415_b51k3jvc_vz1mr0000gn/T/flutter_tools.lzkxYb/flutter_ios_build_temp_dir6KlO8j/temporary_xcresult_bundle


Could not build the application for the simulator.
Error launching application on iPhone 11.

    标签: xcode flutter dart flutter-dependencies


    【解决方案1】:

    它失败的原因是你的 Mac 使用了颤振版本 3,它有一个改变,即小部件绑定不能为空,需要不使用?在 Widget 绑定中。包百分比指示器不兼容 Flutter 3。请将版本更改为与 Flutter 3 兼容的 percent_indicator: ^4.2.2。进行flutter clean和pod install,它应该可以工作

    编辑

    要清理您的 pub 缓存,您可以运行 flutter pub cache clean

    请注意,这将清除所有 pub 缓存,之后您可能必须在所有项目上运行 flutter pub get

    【讨论】:

    • 我在颤振 3 之前使用颤振 2.10.5 和 percent_indicator: ^4.0.1 因为所有软件包都不兼容。我已经尝试过 clean / pod install / remove pods 等
    • 在 Mac 中,flutter 版本看起来像 3。请您仔细检查一下。并且正在使用百分比指标 4.2.1
    • 很抱歉造成混乱,我已经很好地测试了 4.2.1,但是在出错后我也测试降级到 4.0.1 但总是同样的问题。这是我的颤振医生 [✓] Flutter(通道未知,2.10.5,macOS 11.4 20F71 darwin-x64,区域设置 fr-FR)
    • 观察 -> 当我创建一个仅加载 percent_indicator :4.2.1 的新项目时,它运行没有错误
    • 在终端中运行此命令。切换到稳定频道flutter channel stable
    【解决方案2】:

    如果您使用 M1 Mac,请使用以下步骤

    如果您使用的是 Firebase,请尝试使用

    cloud_firestore: 3.2.1
    firebase_analytics: ^9.3.1
    firebase_core: 1.19.1
    firebase_auth: ^3.6.3
    

    终端

    flutter clean
    sudo arch -x86_64 gem install ffi
    arch -x86_64 pod update
    

    可能需要一点时间。

    改变你的 Podfile

    platform :ios, '14.0' 
    

    【讨论】:

      猜你喜欢
      • 2021-08-02
      • 2021-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-21
      • 2023-03-10
      • 2020-12-06
      • 1970-01-01
      相关资源
      最近更新 更多