mapbox-unity-sdk icon indicating copy to clipboard operation
mapbox-unity-sdk copied to clipboard

'MapboxMobileEvents/MapboxMobileEvents.h' file not found

Open dorkbot opened this issue 6 years ago • 8 comments

This error is back. I'm getting it in XCode. I've tried these solutions and they didn't work.

https://github.com/mapbox/mapbox-unity-sdk/issues/644 https://github.com/mapbox/mapbox-unity-sdk/issues/589

  • Unity version: 2019.2.8f1
  • Scripting Backend: IL2CPP
  • Mapbox SDK version: v2.1.0
  • The platform you're building to: iOS
  • A description of what you're trying to do:
  • Steps to recreate the bug if appropriate: Create an iOS build

dorkbot avatar Oct 08 '19 01:10 dorkbot

I fixed the issue by doing this:

"I also had to manually link the libz library to the project, that can be done by going to the Build Phases tab and expand Link Binary With Libraries. Click the + button and search for libz.tbd and press Add"

I got this tip from here: https://github.com/mapbox/mapbox-unity-sdk/issues/644

dorkbot avatar Oct 08 '19 02:10 dorkbot

Also getting this, manually adding the include path ("$(SRCROOT)/Libraries/Plugins/Mapbox" recursive) helped for now. Please fix this properly

kjyv avatar Oct 11 '19 16:10 kjyv

Simple fix: in /Mapbox/Unity/Editor/Build/Mapbox_iOS_build.cs, change line 26 from:

string target = proj.TargetGuidByName("Unity-iPhone");

to

string target = proj.GetUnityFrameworkTargetGuid();

Further explained in PR #1513.

AtlantisPleb avatar Dec 08 '19 06:12 AtlantisPleb

I don't have that file in the Mapbox tree after I have it imported through the 2.1.1 package. In fact no Editor scripts at all. The previous code looks like it could also still work, so maybe something is simply missing? Also noted it still fails even with the path added when checking "Symlink Unity libraries" before build.

kjyv avatar Jan 29 '20 09:01 kjyv

Mange to get in work in Unity 2019.3.15f1

The problem is that TargetGuidByName() has been deprecated so you need to go and replace it with GetUnityFrameworkTargetGuid() in order to fix 'MapboxMobileEvents.h' file not found in xcode.

There are two scripts that you need to change:

1- Mapbox_iOS_build You can find the script at Mapbox/Unity/Editor/Build/Mapbox_iOS_build.cs, change line 26 string target = proj.TargetGuidByName("Unity-iPhone"); to string target = proj.GetUnityFrameworkTargetGuid();

2- UnityARBuildPostprocessor You can find the script at UnityARKitPlugin/Plugins/iOS/UnityARKit/Editor/UnityARBuildPostprocessor Go to Line 80 and 81 change the code to the following proj.AddFrameworkToProject(proj.GetUnityFrameworkTargetGuid(), "ARKit.framework", false); string target = proj.GetUnityFrameworkTargetGuid();

Nima-Jamalian avatar Jun 04 '20 23:06 Nima-Jamalian

I was having this issue: <'MapboxMobileEvents/MapboxMobileEvents.h' file not found>. I solved it and did not have to do anything in the Build Settings or in the Build Phases.

Instead simply followed @Nima-Jamalian 's code edits above^ without any other changes and it worked for me Background: I'm using (Unity 2019.4.2f1) and (Xcode 11.5)

robertborowski avatar Jul 09 '20 17:07 robertborowski

What fixed this for me are the following posts:

  1. Renaming files location reference as described here
  2. Make sure you have the Build folder which gets lost through GIT, as described here

olgv avatar Feb 07 '21 13:02 olgv

Simple fix: in /Mapbox/Unity/Editor/Build/Mapbox_iOS_build.cs, change line 26 from:

string target = proj.TargetGuidByName("Unity-iPhone");

to

string target = proj.GetUnityFrameworkTargetGuid();

Further explained in PR #1513.

This really worked for me. I have copied this file from another project and build starts working. thanks alot.

fareedTahir131 avatar Jan 30 '24 08:01 fareedTahir131