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

[Fix] iOS bitcode build error #645

Merged
merged 5 commits into from
Oct 4, 2023
Merged

[Fix] iOS bitcode build error #645

merged 5 commits into from
Oct 4, 2023

Conversation

shepherd-l
Copy link
Contributor

@shepherd-l shepherd-l commented Oct 3, 2023

Description

One Line Summary

Fixes iOS "does not contain bitcode" build error by disabling bitcode

Details

Motivation

Prevent iOS builds from failing with default "Enable Bitcode" value and documents setting "Enable Bitcode" to "No".

Testing

Manual testing

Tested OneSignal initialization, app build with Unity 2022.3.10f1 of the OneSignal example app on a physical iPhone 12 with iOS 15.5.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

README.md Outdated
@@ -117,7 +117,9 @@ After building in Unity and exporting the XCode project follow these steps:

![extension signing and groups](Documentation/ios_extension_sign_and_groups.png)

6. **App Groups** should now be provisioned for you going forward for your iOS bundle id, even on clean builds.
**App Groups** should now be provisioned for you going forward for your iOS bundle id, even on clean builds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this stay as step 6?

README.md Outdated
6. **App Groups** should now be provisioned for you going forward for your iOS bundle id, even on clean builds.
**App Groups** should now be provisioned for you going forward for your iOS bundle id, even on clean builds.

6. Make sure all **Targets** have **Enable Bitcode** set to **No** in **Build Settings**.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per note above, this should be step 7.

@@ -111,6 +111,14 @@ public class BuildPostProcessor : IPostprocessBuildWithReport {
// Add the service extension
AddNotificationServiceExtension();

// Unity Tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method's logic is mostly declarative vs imperative. Can we make a new method call something like DisableBitcode()?

@@ -152,6 +160,8 @@ public class BuildPostProcessor : IPostprocessBuildWithReport {
var targetGuid = _project.GetMainTargetGuid();
var targetName = _project.GetMainTargetName();

_project.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is named AddProjectCapabilities which shouldn't touch something unrelated like bitcode. I recommend moving this to the new DisableBitcode() method I suggested above.

@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Sending VSAttribution data from the editor
- iOS notifications clicked event firing if the app was cold started from clicking a notification
- iOS bitcode build error
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would state we are disabling bitcode to avoid a build error.

@shepherd-l shepherd-l merged commit 9c5b08d into user-model/main Oct 4, 2023
1 check passed
@shepherd-l shepherd-l deleted the fix/iosBitcode branch October 4, 2023 19:50
jinliu9508 pushed a commit that referenced this pull request Feb 23, 2024
jinliu9508 pushed a commit that referenced this pull request Feb 27, 2024
jinliu9508 pushed a commit that referenced this pull request Feb 27, 2024
jinliu9508 pushed a commit that referenced this pull request Feb 27, 2024
jinliu9508 pushed a commit that referenced this pull request Feb 27, 2024
jinliu9508 pushed a commit that referenced this pull request Mar 1, 2024
jinliu9508 pushed a commit that referenced this pull request Mar 4, 2024
jinliu9508 pushed a commit that referenced this pull request Mar 4, 2024
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

Successfully merging this pull request may close these issues.

3 participants