react-native-maps: iOS: 'RCTImageLoader.h' file not found.

Trying to add airbnb/react-native-maps to my react native project and follow the guide at https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md. Option 1,

After done, I cannot run the project in Xcode, it gives the error, ‘RCTImageLoader.h’ file not found.

I hv tried run rnpm link and it cannot go through,

rnpm-link info Android module react-native-maps is already linked
rnpm-link info Linking react-native-maps ios dependency
rnpm-link ERR! It seems something went wrong while linking. Error: ENOENT: no such file or directory, open '/Users/nedved/Desktop/NativeCreditcard_office/node_modules/react-native-maps/ios/AirGoogleMaps.xcodeproj/project.pbxproj'
Please file an issue here: https://github.com/rnpm/rnpm/issues

I can find the file /Users/XXXX/node_modules/react-native-maps/ios/AirGoogleMaps.xcodeproj locally, but when clicking, “Project /Users/XXXX/node_modules/react-native-maps/ios/AirGoogleMaps.xcodeproj cannot be opened because it is missing its project.pbxproj file.

Any idea?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17

Most upvoted comments

If you use CocoaPods, may be you should check your Podfile whether you have add RCTImage, like this:

pod 'React', :path => '../node_modules/react-native', :subspecs => [ 'Core', 'CxxBridge', 'DevSupport', 'RCTText', 'RCTImage', # add RCTImage, then **pod install** 'RCTNetwork', 'RCTWebSocket', ]

@gerard0315 got a fixed for it just statically define where your react-native modules are. The header location in the package wont work if you have your project nested one level down of your node modules …

folder scaffolding issue in my case

screenshot_2016-11-11__5_06_pm

I got this issue on RN0.61.1 #import <React/RCTImageLoader.h> in AIRMapOverlay.m gives error: 'React/RCTImageLoader.h' file not found

Here is my podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, "9.0"
require_relative "../node_modules/@react-native-community/cli-platform-ios/native_modules"

target "project" do
  project "project"
  rn_maps_path = "../node_modules/react-native-maps"
  lib_path = "../node_modules/bike-app-library"

  pod "React", :path => "../node_modules/react-native/"
  pod "React-Core", :path => "../node_modules/react-native/"
  pod "React-Core/RCTWebSocket", :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-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"
  pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"

  # React Native third party dependencies podspecs
  pod "DoubleConversion", :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
  pod "Folly", :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec"
  pod "glog", :podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec"

  # React Native Community dependencies podspecs
  pod "react-native-netinfo", :path => "../node_modules/@react-native-community/netinfo"

  # react-native-maps dependencies

  # react-native-geolocation-service dependencies
  pod "react-native-geolocation", path: "../node_modules/@react-native-community/geolocation"

  pod "RNCAsyncStorage", :path => "#{lib_path}/node_modules/@react-native-community/async-storage"
  pod "react-native-ble-plx", :path => "#{lib_path}/node_modules/react-native-ble-plx"
  pod "react-native-ble-plx-swift", :path => "#{lib_path}/node_modules/react-native-ble-plx"

  use_native_modules!
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "react-native-google-maps"
      target.build_configurations.each do |config|
        config.build_settings["CLANG_ENABLE_MODULES"] = "No"
      end
    end

    targets_to_ignore = %w(React yoga)
    if targets_to_ignore.include? target.name
      target.remove_from_project
    end
  end
end

I think it deserves a new issue, especially since it’s not as straightforward, there are other bugs like property 'imageLoader' not found on object of type 'RCTBridge *'

I got this issue on RN0.61.1 #import <React/RCTImageLoader.h> in AIRMapOverlay.m gives error: 'React/RCTImageLoader.h' file not found

Here is my podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, "9.0"
require_relative "../node_modules/@react-native-community/cli-platform-ios/native_modules"

target "project" do
  project "project"
  rn_maps_path = "../node_modules/react-native-maps"
  lib_path = "../node_modules/bike-app-library"

  pod "React", :path => "../node_modules/react-native/"
  pod "React-Core", :path => "../node_modules/react-native/"
  pod "React-Core/RCTWebSocket", :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-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"
  pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"

  # React Native third party dependencies podspecs
  pod "DoubleConversion", :podspec => "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
  pod "Folly", :podspec => "../node_modules/react-native/third-party-podspecs/Folly.podspec"
  pod "glog", :podspec => "../node_modules/react-native/third-party-podspecs/glog.podspec"

  # React Native Community dependencies podspecs
  pod "react-native-netinfo", :path => "../node_modules/@react-native-community/netinfo"

  # react-native-maps dependencies

  # react-native-geolocation-service dependencies
  pod "react-native-geolocation", path: "../node_modules/@react-native-community/geolocation"

  pod "RNCAsyncStorage", :path => "#{lib_path}/node_modules/@react-native-community/async-storage"
  pod "react-native-ble-plx", :path => "#{lib_path}/node_modules/react-native-ble-plx"
  pod "react-native-ble-plx-swift", :path => "#{lib_path}/node_modules/react-native-ble-plx"

  use_native_modules!
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == "react-native-google-maps"
      target.build_configurations.each do |config|
        config.build_settings["CLANG_ENABLE_MODULES"] = "No"
      end
    end

    targets_to_ignore = %w(React yoga)
    if targets_to_ignore.include? target.name
      target.remove_from_project
    end
  end
end

same issue. root cause is React/RCTImageLoader.h is replaced with ‘React/RCTImageLoaderProtocol.h’ in React-Native 0.61

Please update the library.