OneSignal-Unity-SDK icon indicating copy to clipboard operation
OneSignal-Unity-SDK copied to clipboard

Since ios 16 and latest Xcode, we can't compile

Open joaquingrech opened this issue 3 years ago • 7 comments

I've tried with Unity 2021 and 2022. Since the iOS 16 update with its corresponding Xcode, we can't compile any game.

We get this error on one signal

error build: '/Users/Joaquin/Library/Developer/Xcode/DerivedData/Unity-iPhone-ggifuxhndguhrzeqgdagmddoyqgm/Build/Products/ReleaseForRunning-iphoneos/Pods_OneSignalNotificationServiceExtension.framework/Pods_OneSignalNotificationServiceExtension(Pods-OneSignalNotificationServiceExtension-dummy.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/Joaquin/Library/Developer/Xcode/DerivedData/Unity-iPhone-ggifuxhndguhrzeqgdagmddoyqgm/Build/Products/ReleaseForRunning-iphoneos/Pods_OneSignalNotificationServiceExtension.framework/Pods_OneSignalNotificationServiceExtension' for architecture arm64

I've tried everything playing with enable bitcode but it doesn't compile.

any ideas?

joaquingrech avatar Oct 08 '22 12:10 joaquingrech

@joaquingrech Could you provide the following details:

  • Exact version of the OneSignal Unity SDK you are using.
  • Exact Xcode version. (Xcode 14.0, 14.0.1, or 14.1?)
  • Exact version of Cocoapods installed. (Can run pod --version in the terminal to get this version)
  • Under each target in Xcode go to "Build Settings" and search for the setting "Enable Bitcode". Report if this says "Yes" or "No" for each target to us.

Can you manually try turning "Enable Bitcode" to "No" on each target? (But please make a note before changing and report what they were on this github ticket)

jkasten2 avatar Oct 21 '22 00:10 jkasten2

Any news on this? Since updating xCode and test device to iOS 16, same exact issue.

DanielZ15 avatar Nov 22 '22 12:11 DanielZ15

We're seeing this too:

  • Unity Version 2020.3.25

  • Exact version of the OneSignal Unity SDK you are using: 3.0.5
    
  • Exact Xcode version. (Xcode 14.0, 14.0.1, or 14.1?): 14.0.1
    
  • Exact version of Cocoapods installed. (Can run pod --version in the terminal to get this version): 1.11.3
    
  • Under each target in Xcode go to "Build Settings" and search for the setting "Enable Bitcode". Report if this says "Yes" or "No" for each target to us.: It says No
    

issfire avatar Nov 29 '22 19:11 issfire

@jkasten2 Is there any way to force Enable Bitcode to No for OneSignalNotificationServiceExtension upon Unity build (export for Xcode)?

I use pbxProject.SetBuildProperty(target, "ENABLE_BITCODE", "NO"); in IOSPostProcessings to set Enable Bitcode to false for Unity targets and it works. But I failed to get the TargetGuid for OneSignal extension by name, to be able to run the SetBuildProperty on it.

roointan avatar Nov 30 '22 11:11 roointan

@roointan @issfire Can you try to updating to Xcode 14.1? Another OneSignal customer reported after updating they no longer have this issue. (#546)

jkasten2 avatar Dec 12 '22 17:12 jkasten2

@jkasten2 Yes, I had to do some things to be able to compile and run correctly. But, disabling bitcode for Onesignal was not among them, it was not needed: https://github.com/OneSignal/OneSignal-Unity-SDK/issues/553#issuecomment-1345560374

roointan avatar Dec 12 '22 17:12 roointan

I find the solution to resolve, modify the corresponding target build setting: set ENABLE_BITCODE to no for the target of OneSignalNotificationServiceExtension

[PostProcessBuild(46)]
    public static void OnPostProcessBuild(BuildTarget target, string path)
    {
        if (target != BuildTarget.iOS) return;

        string pbxProjectPath = PBXProject.GetPBXProjectPath(path);
        PBXProject pbxProject = new PBXProject();
        pbxProject.ReadFromFile(pbxProjectPath);

        string targetGuid = pbxProject.TargetGuidByName("OneSignalNotificationServiceExtension");
        if (!string.IsNullOrEmpty(targetGuid))
        {
            pbxProject.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");
            pbxProject.WriteToFile(pbxProjectPath);
        }
    }

take care to set PostProcessBuild to 46, check this thread: https://github.com/OneSignal/OneSignal-Unity-SDK/issues/509 and this https://github.com/googlesamples/unity-jar-resolver#appending-text-to-generated-podfile

xinatcg avatar Mar 28 '23 16:03 xinatcg