@@ -82,8 +82,10 @@ public static void OnPostprocessBuild (BuildTarget buildTarget, string path)
82
82
if ( path . Contains ( "FirebaseAuth" ) ) {
83
83
MakeChangesForAuth ( tempProject , path , targetId ) ;
84
84
}
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 .
86
86
tempProject . SetBuildProperty ( targetId , "ENABLE_BITCODE" , "NO" ) ;
87
+ string unityFrameworkTargetId = GetUnityFrameworkTargetGuid ( tempProject ) ;
88
+ tempProject . SetBuildProperty ( unityFrameworkTargetId , "ENABLE_BITCODE" , "NO" ) ;
87
89
File . WriteAllText ( projectPath , tempProject . WriteToString ( ) ) ;
88
90
}
89
91
@@ -158,5 +160,16 @@ static string GetMainTargetGUID(object pbxProjectObj) {
158
160
return pbxProject . TargetGuidByName ( PBXProject . GetUnityTargetName ( ) ) ;
159
161
#endif
160
162
}
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
+ }
161
174
}
162
175
#endif
0 commit comments