birkir / react-native-carplay

CarPlay with React Native
https://birkir.dev/react-native-carplay/
MIT License
669 stars 111 forks source link

CPPointOfInterest definition not found build dies when building for iOS 13 #22

Closed martinthedinov closed 4 years ago

martinthedinov commented 4 years ago

I'm using the latest master (version 1.3.0) and trying to build a project on XCode 11.7 for iOS 13. The build process dies on not finding a definition on line 62 of RCTConvert+RNCarPlay.m with Expected a Type as it doesn't recognize CPPointOfInterest. CPPointOfInterest isn't in CarPlay/CarPlay.h as it only appears in iOS 14.

Removing node_modules and reverting back to package version 1.2.0 from yarn, fixes the issue, but that version seems to be very oudated (from 2 years ago). It looks like you added the CarPlay framework support and a bunch of new templates, etc, on the last push, but now the CarPlay framework and associated definitions are required even when building on pre-iOS 14, which can break things.

I'm thinking an easy fix is to conditionally compile that (and any other) definitions if the build is happening on iOS < 14, as per this SO post.

Thoughts?

martinthedinov commented 4 years ago

Submitted a PR that fixes this issue for me when building on target < 14