Яблоко M1. React-native не может создать симулятор iOS

Я установил все зависимости для react native. Все настройки без Россеты. Я создал новый проект в react-native. Затем я запустил в терминале npx react-native run-ios. Симулятор запущен. Но проект не строится. бревно:

0 verbose cli [
0 verbose cli   '/opt/homebrew/Cellar/node/15.8.0/bin/node',
0 verbose cli   '/opt/homebrew/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli   'exec',
0 verbose cli   '--',
0 verbose cli   'react-native',
0 verbose cli   'run-ios'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 0ms
4 timing config:load:file:/opt/homebrew/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 0ms
7 timing config:load:env Completed in 0ms
8 timing config:load:file:/Users/kornick/test2/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/kornick/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/opt/homebrew/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 2ms
19 verbose npm-session 9b37ce5d0c1fcd8b
20 timing npm:load Completed in 6ms
21 timing command:exec Completed in 32017ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/opt/homebrew/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (node:events:378:20)
22 verbose stack     at maybeClose (node:internal/child_process:1067:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
23 verbose pkgid [email protected]
24 verbose cwd /Users/kornick/test2
25 verbose Darwin 20.2.0
26 verbose argv "/opt/homebrew/Cellar/node/15.8.0/bin/node" "/opt/homebrew/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "react-native" "run-ios"
27 verbose node v15.8.0
28 verbose npm  v7.5.2
29 error code 1
30 error path /Users/kornick/test2
31 error command failed
32 error command sh -c react-native "run-ios"
33 verbose exit 1

person Николай Короид    schedule 07.02.2021    source источник


Ответы (1)


решение было следующим. Редактировал Podfile, перед этим перечитал много информации. мой подфайл. после редактирования я запустил установку pod.

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'test2' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'test2Tests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
 # you should disable these next few lines.
  #use_flipper!
  post_install do |installer|
    #flipper_post_install(installer)
    installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
  end
end

target 'test2-tvOS' do
  # Pods for test2-tvOS

  target 'test2-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end
person Николай Короид    schedule 09.02.2021