qiuxiang / react-native-amap3d

react-native 高德地图组件,使用最新 3D SDK,支持 Android + iOS
https://qiuxiang.github.io/react-native-amap3d/api/
MIT License
1.28k stars 328 forks source link

M1上会报 is missing one or more architectures required by this target: x86_64. 设备上正常 #707

Closed 0neSe7en closed 2 years ago

0neSe7en commented 2 years ago
npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 184.16 MB / 32.00 GB
    Shell: 3.3.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.13.0 - ~/.asdf/installs/nodejs/lts/bin/node
    Yarn: 1.22.17 - ~/.asdf/shims/yarn
    npm: 8.1.3 - ~/.asdf/plugins/nodejs/shims/npm
    Watchman: 2021.11.08.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /Users/wsy/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.66.3 => 0.66.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

复现方式: 在一台M1的电脑上:

npx react-native init AwesomeProject --version 0.66.3
cd AwesomeProject
npm i react-native-amap3d
cd ios
pod install
cd ..
npm run ios
qiuxiang commented 2 years ago

我也用 m1,之前没试过模拟器,现在发现确实有问题,这个问题我这边大概也没有什么办法

qiuxiang commented 2 years ago

我之前是直接运行到手机上的,或者用 xcode 直接运行在 macos 上:

image

相比模拟器,这种方式更高效,不过缺点就是会 app 有概率卡死,有段时间没用 macos 了不晓得这个问题修复了没。

0neSe7en commented 2 years ago

嗯嗯,可以的。我先用直接在macos上运行的方式。感谢~

harry118 commented 2 years ago

@0neSe7en @qiuxiang 怎么在MacOS上运行呢?

0neSe7en commented 2 years ago

我就是直接在手机上运行,或者在m1上以原生App的形式运行。

krmao commented 10 months ago

just do this on Apple M2, iphonesimulator can run amap now....


installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# https://stackoverflow.com/questions/72344149/how-to-solve-xcode-build-error-undefined-symbols-for-architecture-x86-64
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
# https://stackoverflow.com/a/62526546/4348530
if Gem::Version.new('12.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end

end end



![image](https://github.com/qiuxiang/react-native-amap3d/assets/7344437/65561223-2c9e-45ba-8ab0-a5cb3173f7ee)