質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.45%
React Native

React Nativeは、ネイティブモバイルアプリ(iOS/Android)を作成できるJavaScriptフレームワークです。Reactと同じ設計のため、宣言的なコンポーネントでリッチなUIを開発することが可能です。

ビルド

ソースコードを単体で実行可能なソフトウェアへ変換する過程をビルド(build)と呼びます

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Q&A

0回答

1535閲覧

'UMCore/UMModuleRegistry.h' file not foundが解消されない

naoya-nakamura

総合スコア0

React Native

React Nativeは、ネイティブモバイルアプリ(iOS/Android)を作成できるJavaScriptフレームワークです。Reactと同じ設計のため、宣言的なコンポーネントでリッチなUIを開発することが可能です。

ビルド

ソースコードを単体で実行可能なソフトウェアへ変換する過程をビルド(build)と呼びます

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

0グッド

0クリップ

投稿2021/11/12 02:40

編集2021/11/12 03:25

前提・実現したいこと

react nativeを使用してアプリを開発していますが、ビルドをする際にエラーが発生しました。
iOSアプリの開発者ではないため、エラーの解消に手間取ってます。
エラーを解消してbuildが通る状態にしたい。

発生している問題・エラーメッセージ

'UMCore/UMModuleRegistry.h' file not found

該当のソースコード

#import <Foundation/Foundation.h> #import <UMCore/UMModuleRegistry.h> typedef enum UMPermissionStatus { UMPermissionStatusDenied, UMPermissionStatusGranted, UMPermissionStatusUndetermined, } UMPermissionStatus; @protocol UMPermissionsRequester <NSObject> + (NSString *)permissionType; - (void)requestPermissionsWithResolver:(UMPromiseResolveBlock)resolve rejecter:(UMPromiseRejectBlock)reject; - (NSDictionary *)getPermissions; @end @protocol UMPermissionsInterface - (void)registerRequesters:(NSArray<id<UMPermissionsRequester>> *)newRequesters; - (void)getPermissionUsingRequesterClass:(Class)requesterClass resolve:(UMPromiseResolveBlock)resolve reject:(UMPromiseRejectBlock)reject; - (BOOL)hasGrantedPermissionUsingRequesterClass:(Class)requesterClass; - (void)askForPermissionUsingRequesterClass:(Class)requesterClass resolve:(UMPromiseResolveBlock)resolve reject:(UMPromiseRejectBlock)reject; @end

試したこと

すでに存在する、Podfile,Gemfileに沿って、以下コマンドを実行(Podfile.lock,Gemfile.lockは名前変更)

bundle exec pod install

以下のエラーが発生したため、以下コマンドを実行しpod update

[!] CocoaPods could not find compatible versions for pod "Firebase/Crashlytics": In snapshot (Podfile.lock): Firebase/Crashlytics (= 7.1.0, ~> 7.1.0) In Podfile: RNFBCrashlytics (from `../node_modules/@react-native-firebase/crashlytics`) was resolved to 10.8.1, which depends on Firebase/Crashlytics (~> 7.6.0) You have either: * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`. * changed the constraints of dependency `Firebase/Crashlytics` inside your development pod `RNFBCrashlytics`. You should run `pod update Firebase/Crashlytics` to apply changes you've made.
bundle exec pod update Firebase/Crashlytics

その後、xcode上でbuildを実施

補足情報(FW/ツールのバージョンなど)

Podfileは以下。

platform :ios, '11.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' require_relative '../node_modules/react-native-unimodules/cocoapods.rb' target 'myproject' do target 'myproject-stg' target 'myproject-dev' # Pods for myproject use_frameworks! pod 'React', :path => '../node_modules/react-native' pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga/yoga.podspec' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" pod 'React-Core', :path => '../node_modules/react-native/' pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" permissions_path = '../node_modules/react-native-permissions/ios' pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec" pod 'Firebase/Messaging' use_unimodules! target 'myprojectTests' do inherit! :search_paths end use_native_modules! static_libraries = ['RNPermissions', 'Permission-Camera'] pre_install do |installer| # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289 Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} installer.pod_targets.each do |target| if static_libraries.include?(target.name) def target.build_type; Pod::BuildType.static_library end end if target.name == "UMPermissionsInterface" # https://github.com/expo/expo/issues/6477 target.dependent_targets << installer.pod_targets.select{|t| t.pod_name == 'UMCore'}.first end if target.name == 'UMReactNativeAdapter' target.dependent_targets << installer.pod_targets.select{|t| t.pod_name == 'React-CoreModules'}.first end end end post_install do |installer| installer.pods_project.targets.each do |target| if ['RNFBApp', 'RNFBMessaging'].include?(target.name) target.add_system_framework(installer.pods_project.targets.find{|target| target.name == 'GoogleUtilities'}) end if ['RNFBCrashlytics'].include?(target.name) target.add_system_framework(installer.pods_project.targets.find{|target| target.name == 'Fabric'}) target.add_system_framework(installer.pods_project.targets.find{|target| target.name == 'Crashlytics'}) end end

Gemfileは以下。

# frozen_string_literal: true source "https://rubygems.org" git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } gem "cocoapods"

'UMCore/UMModuleRegistry.h' file not foundのエラー箇所のissue(https://github.com/expo/expo/issues/6477)を見ていくと、

#import <UMPermissionsInterface/UMPermissionsMethodsDelegate.h> in file included from /Users/hikoyukisakai/workspace/okanpay-reactnative2019/node_modules/unimodules-permissions-interface/ios/UMPermissionsInterface/UMPermissionsMethodsDelegate.m:3:

in fileとなっているため検索しているパスが違う可能性。デフォルト設定だとうまく行かない記事を見つけたので、XcodeのSearchパスの設定見直ししたが、解消せず。
https://teratail.com/questions/62702
https://qiita.com/shtnkgm/items/e1c3c0b7a2dfa67fe7c0

UMPermissionsInterface は node-moduleを確認するとUMCore/UMModuleRegistry には存在しないため

#import <UMCore/UMModuleRegistry.h> ↓ 以下に変更 #import <UMPermissionsInterface/UMPermissionsInterface.h>

file not found のエラーは消えた
Expected a type 別のエラー発生。データの型が見つからない意味らしい

#import<UIKit/UIKit.h>

を追加すると解消するらしいが解消せず・・
http://s-prism3.seesaa.net/article/414478694.htm

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

naoya-nakamura

2021/11/12 05:14

読んでおりませんでしたが、マルチポストはしていない認識です。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.45%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問