Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'MapboxMobileEvents/MapboxMobileEvents.h' file not found #644

Closed
campeezjesse opened this issue Apr 3, 2018 · 16 comments
Closed

'MapboxMobileEvents/MapboxMobileEvents.h' file not found #644

campeezjesse opened this issue Apr 3, 2018 · 16 comments

Comments

@campeezjesse
Copy link

Note: If this is a bug or support ticket, please provide the following information:

  • Unity version: 2017.3
  • Mapbox SDK version: 4.0
  • The platform you're building to: iOS, Xcode last two versions

I have researched this problem and tried every documented solution I could find.

  • Build target 7.0, 8.0, 9.0.
    iPad only, iPhone only, any device.
    Manually add framework and embedded Binary
    add new search paths
    Check that symlink is not checked
    Opened new accounts for Xcode, Mapbox, and Unity
    I add directly to the assets, set build settings for iOS then it builds to Xcode and produces the error.
    I am happy to show you settings but over the last few days I have changed every one of them I can find with no luck.
@tboogh
Copy link

tboogh commented Apr 3, 2018

I've run into the same problem, for me the generated xcode projects are missing a couple of items. First open the XCode project and go to the Build Settings tab and search for Header Search Paths, double click to the row and press the + button and add a line and paste this into it $(SRCROOT)/Libraries/Mapbox/Core/Plugins/iOS/MapboxMobileEvents/include/

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

@campeezjesse
Copy link
Author

campeezjesse commented Apr 3, 2018 via email

@treasurehunters003
Copy link

Still same error for me... Replaced Header Search Paths, add libz.tbd, build without symlink, and still not working.

@igaln
Copy link

igaln commented Jan 2, 2019

Is it possible to automate this on the next release and add as an enhancement?

@unnanego
Copy link

unnanego commented Jun 3, 2019

It's $(SRCROOT)/Libraries/Mapbox/Core/Plugins/iOS/MapboxMobileEvents/include/MapboxMobileEvents but this still doesn't help

@njw275
Copy link

njw275 commented Jun 15, 2019

Added:
$(SRCROOT)/Libraries/Mapbox/Core/Plugins/iOS/MapboxMobileEvents/include/

I also manually added libz.tbd and made sure I wasnt building with symlink

Still nothing....any one with other solutions to this error?

@TiborUdvari
Copy link

It's important to note that the header search files appy to the UnityFramework target and not the Unity-iPhone one. At least in 2019.3 that is the case.

@Nima-Jamalian
Copy link

Nima-Jamalian commented Jun 4, 2020

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();

@WorldForStory
Copy link

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 don't have UnityARKitPlugin/Plugins/iOS/UnityARKit/Editor/UnityARBuildPostprocessor but I do have ARKit XR Plugin and found UnityARBuildPostprocessor. Should I edit that file? Line 80 and 81 are comments so I'm not sure what I should be replacing.

@Nima-Jamalian
Copy link

I don't have UnityARKitPlugin/Plugins/iOS/UnityARKit/Editor/UnityARBuildPostprocessor but I do have ARKit XR Plugin and found UnityARBuildPostprocessor. Should I edit that file? Line 80 and 81 are comments so I'm not sure what I should be replacing.

Replace them with what I have written,
Line 80proj.AddFrameworkToProject(proj.GetUnityFrameworkTargetGuid(), "ARKit.framework", false);
Line 81 string target = proj.GetUnityFrameworkTargetGuid();
It should work.

@rod-m
Copy link

rod-m commented Nov 7, 2020

Updating the deprecated TargetGuidByName to GetUnityFrameworkTargetGuid fixed error in Unity Build.
In XCode 12.1 I still had errors with the missing MapboxMobileEvents.h
What works is to remove folder paths in MapboxMetricsClient.m since these paths were added to the UnityFramework Header Search Paths.
#import <MapboxMobileEvents/MapboxMobileEvents.h>
to
#import <MapboxMobileEvents.h>
Then same in MapboxMobileEvents.h
Remove all folder paths:
#import <MMEConstants.h>
#import <MMEEvent.h>
#import <MMETypes.h>
#import <MMEEventsManager.h>

@MartinMajewski
Copy link

September 2021: error still exists. Still, one has to change to "GetUnityFrameworkTargetGuid()" and still the MapboxMobileEvents.h cannot be found.

Following the advice by @rod-m to remove all folder paths from the imports helps!

But this cannot be the final word. MapBox for Unity needs an overhaul!

@gbhanuteja23
Copy link

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();

Thanks for this solution, doing the option 1 in Unity 2022.3.3f1 also has resolved this library not found issue.

@TheMehranKhan
Copy link

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();

Update in 2023: Using XCode 15 Beta and MacOS Sonoma with iOS 17, Unity version 2021.3.29f1 on MacOS M1, I still had same errors but downloading AR package from Unity and also doing the first step that @Nima-Jamalian provided it compiles and installs on my device. thanks

@oleksiivinogradov
Copy link

terrible!!!
same error from 2018 year and no fixes at all!!!

@minghei
Copy link

minghei commented Mar 8, 2024

2024 now. I think it is dead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests