无法在 Iphone 设备上启动我的 flutter 应用程序以在 Mac M1 上进行调试

问题描述 投票:0回答:1

当我尝试启动应用程序时,出现以下错误。

Xcode build done.                                           18.7s

Failed to build iOS app

Could not build the precompiled application for the device.

Error output from Xcode build:


↳


    ** BUILD FAILED **


2



Xcode's output:


↳


    Writing result bundle at path:


        /var/folders/gx/0xqx8frn70b6846551t3qqtc0000gn/T/flutter_tools.0BGX7l/flutter_ios_build_temp_dir5JolwN/temporary_xcresult_bundle





5
    ld: warning: ignoring duplicate libraries: '-lc++'


    Unhandled exception:


    Null check operator used on a null value


    #0      Context.embedFlutterFrameworks (file:///Users/userabc/Developer/Tools/flutter/packages/flutter_tools/bin/xcode_backend.dart:235:68)


    #1      Context.run (file:///Users/userabc/Developer/Tools/flutter/packages/flutter_tools/bin/xcode_backend.dart:59:9)


    #2      main (file:///Users/userabc/Developer/Tools/flutter/packages/flutter_tools/bin/xcode_backend.dart:17:5)


    #3      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)


    #4      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)


    Command PhaseScriptExecution failed with a nonzero exit code


    warning: Run script build phase 'Create Symlinks to Header Folders' 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 'abseil' from project 'Pods')


    warning: Run script build phase 'Create Symlinks to Header Folders' 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 'BoringSSL-GRPC' from project 'Pods')


    warning: Run script build phase 'Create Symlinks to Header Folders' 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 'gRPC-Core' from project 'Pods')


    warning: Run script build phase 'Create Symlinks to Header Folders' 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 'gRPC-C++' from project 'Pods')


    note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')


    note: Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')

我尝试过:

cd ios
sudo arch -x86_64 gem install ffi
arch -x86_64 pod repo update
arch -x86_64 pod install

根本没用。

> flutter --version
     Flutter 3.22.2 • channel stable • https://github.com/flutter/flutter.git
     Framework • revision 761747bfc5 (5 days ago) • 2024-06-05 22:15:13 +0200
     Engine • revision edd8546116
     Tools • Dart 3.4.3 • DevTools 2.34.3

> pod --version
     1.15.2

如果我运行

flutter doctor -v
,它会说
No issues found

我花了几个小时但没有成功。谁可能遇到过这个问题并解决了它..?

flutter xcode macos dart xcode8
1个回答
0
投票

这似乎是一个 Flutter 问题,由于某种原因,他们几个月都无法解决。

这个帖子正在解释这个问题: https://github.com/flutter/flutter/issues/140845

问题似乎是无法找到/识别 FLUTTER_BUILD_DIR 作为环境变量。更新配置中的调试、发布和配置文件信息解决了问题,如上面链接中给出的 GitHub 问题中所述。

© www.soinside.com 2019 - 2024. All rights reserved.