react-native-maps-osmdroid icon indicating copy to clipboard operation
react-native-maps-osmdroid copied to clipboard

iOS build error: RCTConvert+AirMap.h not found

Open maartenvandillen opened this issue 5 years ago • 3 comments

Is this a bug report?

probably not

Have you read the Installation Instructions?

Yes. I was wondering if the installation instructions from react-native-maps is still to be followed when installing this repo react-native-maps-osmdroid. Especially all parts involving Google Maps.

Also wondering what to add to the Podfile when the goal is to use AppleMaps.

Environment

react-native: 0.61.5 react: 16.9.0 react-native-maps-osmdroid: 0.26.1-unreleased trying to use AppleMaps

Steps to Reproduce

Follow installation instructions, open xcode workspace and build.

Expected Behavior

No build errors

Actual Behavior

xcode gives one or two build errors, both involving missing header files from the AirMap project. E.g. this line fails: #import "RCTConvert+AirMap.h" in file AIRGoogleMap.h

I've tried adding $(SRCROOT)../node_modules/react-native-maps-osmdroid/lib/ios/AirMaps to the header search paths of the build target but that doesn't seem to help.

What I'm trying to accomplish is use the react-native-maps-osmdroid in my project without the need for Google Maps (api key). On Android OSM would be fine, on iOS AppleMaps would be great.

Reproducible Demo

maartenvandillen avatar Feb 20 '20 15:02 maartenvandillen

For some reason, the autolink on cocoapods is autolinking the GoogleMaps integration pod instead of the main one. For me it happens even using the original lib. I couldn't find a bug on the repo though.

The workaround is disabling autolink for the lib, and linking by hand:

react-native.config.js

module.exports = {
  dependencies: {
    'react-native-maps-osmdroid': {
      platforms: {
        ios: null,
      },
    },
  },
};

And add this to your podfile:

  # workaround: manual link to avoid error by wrong podfile linked
  pod 'react-native-maps', :path => '../node_modules/react-native-maps-osmdroid'

fqborges avatar Feb 21 '20 15:02 fqborges

Thank you very much for looking into this. Your workaround is working! Should we submit an issue on the original repo for this?

maartenvandillen avatar Feb 22 '20 09:02 maartenvandillen

My bad, this issue happens only on this repo. I should reconfig autolink since package name changed.

fqborges avatar Mar 03 '20 13:03 fqborges