3

Good Afternoon

I am trying to implement googles heatmaps into my map based project. In this particular project, I get the following errors when trying to build.

  failed to emit precompiled header '/Users/zachwilcox/Library/Developer/Xcode/DerivedData/OddJobs-gbnkfettubuccoheinzfovrqefub/Build/Intermediates.noindex/PrecompiledHeaders/OddJobs-Bridging-Header-swift_3WGH9SNI96Z2-clang_16JN3VASQHE4C.pch' for bridging header '/Users/zachwilcox/Desktop/OddJobs/OddJobs-Bridging-Header.h'

Failed to emit precompiled header

and a follow up that says

  'Google-Maps-iOS-Utils/GMUHeatmapTileLayer.h' file not found

.h file not found

I'm not sure why this is happening because I created an entirely new project and did the same implementation and it worked perfectly. But when I run it on my existing project I get these two errors.

I have been researching this problem for a while now and I can't figure out what the problem is. I have the Bridging header set to the .h file. bridging header

I have tried most steps that individuals have tried to give with their answers but for some reason, it's not working for my project. Thank you in advance. When reading googles installation guide, it said that all I needed to add was one bridging header file which is the code you see in the image below. When researching it, I have seen that I needed to add a .m file as well however I still get the same error when I do. again, in my dummy project, I don't have the .m file just everything you see below and everything compiles.

  • When I comment out the bridging-Header.h it runs. so that leads me to think that it isnt the search path. –  Dec 18 '18 at 07:58
  • After constantly researching this I was finally able to figure out an answer. I see there are many different variations to answers posted on this site that try to fix this, but what I did was follow this [guide](https://github.com/googlemaps/google-maps-ios-utils/blob/master/Swift.md). I hope if anyone else has this same problem this helps them out. –  Dec 18 '18 at 18:40
  • Hi, I'm encountering the same issue. Try to lick on the "guide" but "page is not found". Can you help to share the guide again, please? Thanks – Thao Tran Feb 26 '21 at 11:42

2 Answers2

0

There are chances you have 'Find Implicit Dependencies" turned off for the selected Scheme. If you have updated/installed pods and try to build the project, it will more likely fail if this option is unchecked for the selected Scheme.enter image description here

From Apple's Document:

Parallelize Build – This option allows Xcode to speed up total build time by building targets that do not depend on each other at the same time. This is a time-saver on projects with many smaller dependencies that can easily be run in parallel.

Find Implicit Dependencies – This is a very powerful option that allows Xcode to resolve what targets need to be built for the primary target of the scheme to be built successfully. However, this does come with some sharp edges that you have to be aware of.

  • Situation: You link a library against your application target and create an implicit dependency to that library’s target.

  • Scenario 1: “Find Implicit Dependencies” is enabled.

    • Result: The library will get built prior to building the application target. The application target will then link against the library and build successfully.
  • Scenario 2: “Find Implicit Dependencies” is disabled.

    • Result: The library will not get built prior to building the application target. The application target fail to build.

    • Fix: To ensure that the second scenario does not happen, you must add the necessary targets into the targets list and order them correctly.

rajugautam
  • 78
  • 6
-1

If your project includes pod then you've to set the pod configuration for the test project too..

Select Root Project in File inspector -> Project Name -> Info -> Configurations Set configuration for your test project same like your main project enter image description here

Avinash
  • 4,304
  • 1
  • 23
  • 18