@@ -82,8 +82,10 @@ public static void OnPostprocessBuild (BuildTarget buildTarget, string path)
8282 if ( path . Contains ( "FirebaseAuth" ) ) {
8383 MakeChangesForAuth ( tempProject , path , targetId ) ;
8484 }
85- // Bitcode is unnecessary, as we are not submitting these to the Apple store .
85+ // Bitcode is being deprecated by xcode, but Unity defaults to it on, so turn it off .
8686 tempProject . SetBuildProperty ( targetId , "ENABLE_BITCODE" , "NO" ) ;
87+ string unityFrameworkTargetId = GetUnityFrameworkTargetGuid ( tempProject ) ;
88+ tempProject . SetBuildProperty ( unityFrameworkTargetId , "ENABLE_BITCODE" , "NO" ) ;
8789 File . WriteAllText ( projectPath , tempProject . WriteToString ( ) ) ;
8890 }
8991
@@ -158,5 +160,16 @@ static string GetMainTargetGUID(object pbxProjectObj) {
158160 return pbxProject . TargetGuidByName ( PBXProject . GetUnityTargetName ( ) ) ;
159161 #endif
160162 }
163+
164+ static string GetUnityFrameworkTargetGuid ( object pbxProjectObj ) {
165+ var pbxProject = ( PBXProject ) pbxProjectObj ;
166+ // In 2019.3 Unity changed this API without an automated update path via the api-updater.
167+ // There doesn't seem to be a clean version-independent way to handle this logic.
168+ #if UNITY_2019_3_OR_NEWER
169+ return pbxProject . GetUnityFrameworkTargetGuid ( ) ;
170+ #else
171+ return pbxProject . TargetGuidByName ( "UnityFramework" ) ;
172+ #endif
173+ }
161174}
162175#endif
0 commit comments