skip to Main Content

I have an app that I can run on my PC, but when I try to run on my mac with the same code I have this error who stop running.

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.

After flutter pub cache clean I have some new issues

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.

2

Answers


  1. The reason why it failed is that your Mac used flutter version 3 which has a change that widget binding cannot be null which required not to use? In Widget binding. The package percentage indicator is not flutter 3 compatible. Please change the version to percent_indicator: ^4.2.2 which is flutter 3 compatible. Do a flutter clean and pod install and it should work

    Edit

    To clean your pub cache you can run flutter pub cache clean

    Please note that this will clear all your pub cache which after that you may have to run flutter pub get on all projects

    Login or Signup to reply.
  2. Use the follow steps if you use M1 Mac

    If you are using Firebase, try to use

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

    Change your Podfile

    platform :ios, '14.0' 
    

    Terminal

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

    Could take a bit time.

    If not work

    Other thing could be .. update your Mac SO, I read some about problems with Monterrey SO, then try to update ,also update Xcode . Good luck

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search