'MapboxMobileEvents/MapboxMobileEvents.h' file not found
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
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
Also getting this, manually adding the include path ("$(SRCROOT)/Libraries/Plugins/Mapbox" recursive) helped for now. Please fix this properly
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.
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.
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();
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)
What fixed this for me are the following posts:
- Renaming files location reference as described here
- Make sure you have the
Buildfolder which gets lost through GIT, as described here
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.