Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joaquingrech opened this issue Oct 8, 2022 · 7 comments
Open

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

joaquingrech opened this issue Oct 8, 2022 · 7 comments

Comments

@joaquingrech
Copy link

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?

@jkasten2
Copy link
Member

jkasten2 commented Oct 21, 2022

@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)

@DanielZ15
Copy link

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

@issfire
Copy link

issfire commented Nov 29, 2022

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
    

@roointan
Copy link

roointan commented Nov 30, 2022

@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.

@jkasten2
Copy link
Member

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

@roointan
Copy link

@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:
#553 (comment)

@xinatcg
Copy link

xinatcg commented Mar 28, 2023

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: #509 and this https://github.com/googlesamples/unity-jar-resolver#appending-text-to-generated-podfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants