导入Google Ads插件后,Unity 2017.3.0f3构建iOS项目卡于Converting managed assemblies to C++
I’ve dealt with this exact frustrating hang in Unity 2017.3.0f3 when integrating Google Ads before—let’s walk through the fixes that worked for me and other developers:
Use a Google Ads Plugin Version Compatible with Unity 2017.x
Unity 2017.3 is an older release, and many recent Google Ads plugins drop support for it. Look for a plugin version that explicitly lists Unity 2017.x in its release notes. First, uninstall your current plugin (delete allAssets/GoogleMobileAdsfiles), then import the compatible version.Tweak IL2CPP Build Settings
Navigate toEdit > Project Settings > Player > Other Settings > Configuration:- Ensure
Scripting Backendis set toIL2CPP - Under
IL2CPP Code Generation Options, selectFaster (smaller) builds - Try setting
Managed Stripping LeveltoMediumorHigh—this reduces the number of assemblies being converted, which often resolves the hang
- Ensure
Clear Unity’s Cache and Temp Files
Corrupted cache files are a common culprit. Close Unity completely, then delete these folders:<YourProjectPath>/Library<YourProjectPath>/Temp%USERPROFILE%/AppData/Local/Unity/Cache(Windows) or~/Library/Caches/Unity(Mac)
Restart Unity and attempt the build again.
Check for Plugin Conflicts
Other ad SDKs or third-party libraries might clash with Google Ads. Temporarily remove any other ad mediation tools or SDKs, then try building. If it succeeds, you’ll need to find compatible versions of the conflicting plugins or adjust their integration settings.Force a Full Asset Reimport
Go toAssets > Reimport Allin Unity. This ensures all plugin files are properly processed and linked, fixing hidden import issues that can stall the IL2CPP conversion.Verify iOS Build Configuration
For iOS targets:- Set
Target SDKtoDevice SDK(if building for a physical device) instead ofSimulator SDK - Ensure
Architectureis set toUniversalor the specific architecture you need—mismatched settings can cause the assembly conversion to hang indefinitely
- Set
If none of these steps work, try creating a fresh Unity project, import only the Google Ads plugin, and build an iOS project. If that works, gradually migrate your existing assets into the new project to isolate the root cause.
内容的提问来源于stack exchange,提问作者Hamza Azmat

