#xcode #react-native #react-native-ios
Вопрос:
У меня есть встроенное приложение react native только в среде Android, все было нормально. затем позже я решил запустить его в iOS, я следовал официальной документации о том, что требуется для запуска в среде iOS, затем я запускаю pod install
папку iOS и делаю некоторые ссылки для некоторых пакетов, но в итоге сборка не удалась с большим количеством предупреждений и ошибок. Я не мог понять, в чем именно заключается проблема. каждый run react-native run-ios
раз, когда я получал другую ошибку, отличную от предыдущей.
я также попытался очистить кэш модулей с помощью этих команд
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
rm -rf ~/Library/Developer/Xcode/DerivedData/*
pod deintegrate
pod setup
pod install
а также удаленную node_modules
папку и переустановите ее снова. но ничего не работает.
Теперь я получаю эту ошибку:
Не удалось выполнить следующие команды сборки: Ld /Users/mzc/Library/Developer/Xcode/DerivedData/qlessNew-fkilqkvhfxtgydazlsprlgsyfnfn/Build/Products/Debug-iphonesimulator/qlessNew.app/Новое приложение нормально (1 сбой)
Однако, когда я создавал приложение в xcode, я получил эти ошибки:
this is the environments info:
System:
OS: macOS 11.4
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 48.61 MB / 16.00 GB
Shell: 5.1.4 - /usr/local/bin/bash
Binaries:
Node: 15.14.0 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.10.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7199119
Xcode: 12.5/12E262 - /usr/bin/xcodebuild
Languages:
Java: 16.0.1 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.4 => 0.63.4
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
and this is package.json
file:
{
"name": "qlessNew",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@ant-design/react-native": "^4.0.7",
"@freakycoder/react-native-bounceable": "^0.1.1",
"@freakycoder/react-native-helpers": "^1.0.1",
"@react-native-community/async-storage": "^1.12.1",
"@react-native-community/blur": "^3.6.0",
"@react-native-community/cameraroll": "^4.0.2",
"@react-native-community/checkbox": "^0.5.7",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/segmented-control": "^2.2.2",
"@react-native-community/slider": "^3.0.3",
"@react-native-community/viewpager": "^3.3.0",
"@react-native-firebase/app": "^12.1.0",
"@react-native-firebase/auth": "^12.1.0",
"@react-native-firebase/firestore": "^12.1.0",
"@react-native-firebase/storage": "^12.1.0",
"@react-native-google-signin/google-signin": "^6.0.0",
"@react-native-picker/picker": "^1.9.12",
"@react-navigation/bottom-tabs": "^5.11.2",
"@react-navigation/drawer": "^5.11.4",
"@react-navigation/material-top-tabs": "^5.3.14",
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.12.8",
"@reduxjs/toolkit": "^1.5.1",
"axios": "^0.21.1",
"firebase-tools": "^9.13.1",
"install": "^0.13.0",
"lodash": "^4.17.21",
"lottie-ios": "3.1.8",
"lottie-react-native": "^4.0.2",
"native-base": "^2.15.2",
"react": "16.13.1",
"react-native": "0.63.4",
"react-native-action-button": "^2.8.5",
"react-native-androw": "^0.0.34",
"react-native-animatable": "^1.3.3",
"react-native-apple-card-views": "^2.1.2",
"react-native-awesome-card-io": "^0.9.0",
"react-native-camera": "^3.43.6",
"react-native-checkbox-card": "^0.1.0",
"react-native-counter-input": "^0.1.9",
"react-native-credit-card-input": "^0.4.1",
"react-native-elements": "^3.3.1",
"react-native-gesture-handler": "^1.10.3",
"react-native-gradient-header": "^0.2.1",
"react-native-image-header-scroll-view": "^0.10.3",
"react-native-image-helper": "^0.0.3",
"react-native-image-slider-box": "^1.0.12",
"react-native-iphone-x-helper": "^1.3.1",
"react-native-keyboard-aware-scroll-view": "^0.9.3",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-modal": "^11.7.0",
"react-native-multi-grid-selection": "^0.1.6",
"react-native-onboarding-swiper": "^1.1.4",
"react-native-pager-view": "^5.1.2",
"react-native-paper": "^4.7.2",
"react-native-payments": "^0.8.3",
"react-native-permission-service": "^0.1.0",
"react-native-permissions": "^3.0.2",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-qrcode-scanner-view": "^2.0.0",
"react-native-reanimated": "^1.13.2",
"react-native-redash": "^16.0.8",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^2.18.1",
"react-native-share": "^5.1.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "^12.1.0",
"react-native-swipe-list-view": "^3.2.5",
"react-native-swipe-modal-up-down": "^1.0.9",
"react-native-swiper": "^1.6.0",
"react-native-tab-view": "^2.16.0",
"react-native-tabview": "^1.0.0",
"react-native-tear-lines": "^1.0.5",
"react-native-toast-message": "^1.4.9",
"react-native-vector-icons": "^7.1.0",
"react-navigation-drawer": "^2.7.0",
"react-navigation-stack": "^2.10.2",
"react-redux": "^7.2.3",
"reanimated-bottom-sheet": "^1.0.0-alpha.22",
"redux": "^4.0.5",
"styled-components": "^5.2.1",
"tipsi-stripe": "^9.0.0"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/runtime": "^7.8.4",
"@react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^25.1.0",
"eslint": "^6.5.1",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
and Podfile
:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '14.3'
target 'qlessNew' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
pod 'Braintree', :inhibit_warnings => true
# Add the pod for Firebase Crashlytics
pod 'Firebase/Crashlytics'
# Recommended: Add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# Install additional dependencies
pod 'tipsi-stripe', :path => '../node_modules/tipsi-stripe'
target 'qlessNewTests' 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!({ 'Flipper-Folly' => '2.3.0' })
#post_install do |installer|
# flipper_post_install(installer)
#end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 14.3
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.3'
end
end
end
end
target 'qlessNew-tvOS' do
# Pods for qlessNew-tvOS
target 'qlessNew-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end