Search
  • Madhu Kalva

Unity: iOS build errors compilation

Updated: Mar 6



Missing RegisterMonoModule.h


With Unity 2019.3 or above if you use Facebook SDK you will get this error Missing RegisterMonoModule.h while building in XCode.


To fix this you can use this - https://gist.github.com/ntratcliff/3942abd1eed9d704713a27616f09628b


Exception: Calling TargetGuidByName with name='Unity-iPhone' is deprecated.


In my case, I am using Unity 2019.4.17f1 and integrating MoPub for monetization. Then, I see this error when I try to build for iOS.


To fix this have to use GetUnityMainTargetGuid instead of TargetGuidByName.

So replace following

var target = project.TargetGuidByName("Unity-iPhone");

with

var target =
	#if UNITY_2019_3_OR_NEWER    
	    project.GetUnityMainTargetGuid();
	#else    
	    project.TargetGuidByName("Unity-iPhone");
	#endif

Reference: https://github.com/mopub/mopub-unity-sdk/issues/111



'MoPub.h' file not found

When I integrated MoPub's Facebook Audience Network(FAN) mediation network, I saw this error. This is because FAN uses use_frameworks! and iOS won't build with use_frameworks! in Podfile.


Workaround:

  1. Remove <iosPod name="MoPub-SDK-Plugin" minTargetSdk="10.0" path="Assets/MoPub/Plugins/iOS"/> from Assets/MoPub/Scripts/Editor/MoPubDependencies.xml

  2. Delete Assets/MoPub/Plugins/iOS/MoPub-SDK-Plugin.podspec

  3. Check iOS as platform for plugin for all files inside Assets/MoPub/Plugins/iOS


Reference: https://github.com/mopub/mopub-unity-sdk/issues/151


20 views0 comments

Recent Posts

See All

Unity Editor errors compilation

Error: 'UIElements' does not exist in the namespace 'UnityEngine.Experimental' When I import Unity Recorder from Window - > Package Manager it is throwing following errors: Assets/Unity Recorder/Edito

Unity Paid Assets compilation for Hyper Casual Games

Puppet Master: https://assetstore.unity.com/packages/tools/physics/puppetmaster-48977 FInal IK: https://assetstore.unity.com/packages/tools/animation/final-ik-14290 KenShape: Draw in 2D, set the depth

Unity Free Assets compilation for Hyper Casual Games

In this post I will keep track of interesting assets that can be used for hyper casual games. This is for my own reference and to help other developers as well. Another assets compilation for hyper ca