Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter run 报错 (Apple M1) #23

Closed
zhuscat opened this issue Feb 20, 2024 · 2 comments
Closed

flutter run 报错 (Apple M1) #23

zhuscat opened this issue Feb 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zhuscat
Copy link

zhuscat commented Feb 20, 2024

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.0, on macOS 14.0 23A344 darwin-arm64, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.86.0)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

模拟器是 iPhone15 iOS 17
报错如下:

[   +1 ms] Error (Xcode): Building for 'iOS-simulator', but linking in object file

(/Users/zhuliangzhen/dev/learning/Mood-Example/ios/Runner/UniMPSDK/Core/Libs/liblibWeex.
           a[arm64][2](uni_api_file_stream_export.o)) built for 'iOS'
           
[        ] Error (Xcode): Linker command failed with exit code 1 (use -v to see
invocation)
           
[        ] Could not build the application for the simulator.
[        ] Error launching application on iPhone 15.
[   +4 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand
(package:flutter_tools/src/commands/run.dart:811:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command.dart:1389:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure>
           (package:flutter_tools/src/runner/flutter_command_runner.dart:355:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand
           (package:flutter_tools/src/runner/flutter_command_runner.dart:295:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure>
           (package:flutter_tools/runner.dart:119:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure>
           (package:flutter_tools/src/base/context.dart:153:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>

系统信息:

  • Apple M1 Pro
  • macOS 14.0 (23A344)

求帮助😭

@AmosHuKe
Copy link
Owner

AmosHuKe commented Feb 21, 2024

@zhuscat
感谢你的反馈~ 😄

这个问题应该是兼容问题,M1 上模拟器会出现(真机不会出现),
我刚才提了一些新的代码,排除了模拟器上的 arm64,

你可以 pull 一下最新的代码,或者重新 clone 代码。

记得先 flutter clean 一下,再尝试。

我手上只有 Intel CPU 的 Mac,无法得知现在的改动是否能解决问题,
还需要你实际运行测试一下。

@AmosHuKe AmosHuKe changed the title flutter run 报错 flutter run 报错 (Apple M1) Feb 21, 2024
@AmosHuKe AmosHuKe added the bug Something isn't working label Feb 21, 2024
@zhuscat
Copy link
Author

zhuscat commented Feb 21, 2024

@AmosHuKe 经过试验,没有问题了,感谢~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants