diff --git a/MIGRATION_GUIDE_v3_to_v5.md b/MIGRATION_GUIDE_v3_to_v5.md index 62a683f27..7f45d39a8 100644 --- a/MIGRATION_GUIDE_v3_to_v5.md +++ b/MIGRATION_GUIDE_v3_to_v5.md @@ -250,7 +250,7 @@ The debug namespace is accessible via `OneSignal.Debug` and provides access to d - We will be introducing JWT in a follow up release # Troubleshooting - +## Android ``` Assets/OneSignal/Example/OneSignalExampleBehaviou.cs: error CS0246: The type or namespace name '...' could not be found (are you missing a using directive or an assembly reference?) ``` @@ -283,4 +283,13 @@ Execution failed for task ':launcher:mergeReleaseJavaResource'. 1. Go to **Player Settings** and click the Android Tab. Under **Publishing Settings**, enable the following: - Custom Main Gradle Template - Custom Gradle Properties Template -2. Resolve Android dependencies with EDM4U at **Assets > External Dependency Manager > Android Resolver > Force Resolve** \ No newline at end of file +2. Resolve Android dependencies with EDM4U at **Assets > External Dependency Manager > Android Resolver > Force Resolve** + +## iOS +**Build error** +``` +'/Users/.../Library/Developer/Xcode/DerivedData/Unity-iPhone-.../Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/OneSignalXCFramework/OneSignalCore/OneSignalCore.framework/OneSignalCore' 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/.../Library/Developer/Xcode/DerivedData/Unity-iPhone-.../Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/OneSignalXCFramework/OneSignalCore/OneSignalCore.framework/OneSignalCore' for architecture arm64 +``` + +1. For each target, select the **Build Settings** tab +2. Set **Enable Bitcode** to **No** \ No newline at end of file diff --git a/OneSignalExample/Assets/OneSignal/CHANGELOG.md b/OneSignalExample/Assets/OneSignal/CHANGELOG.md index 49366b8a3..141a220b3 100644 --- a/OneSignalExample/Assets/OneSignal/CHANGELOG.md +++ b/OneSignalExample/Assets/OneSignal/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Sending VSAttribution data from the editor - iOS notifications clicked event firing if the app was cold started from clicking a notification - ClassNotFoundException: com.onesignal.OneSignal for Android builds with minify enabled. You must run the "Copy Android plugin to Assets" step in **Window > OneSignal SDK Setup**. +- Disabled bitcode to avoid iOS build error ## [5.0.2] ### Fixed diff --git a/OneSignalExample/Assets/OneSignal/MIGRATION_GUIDE_v3_to_v5.md b/OneSignalExample/Assets/OneSignal/MIGRATION_GUIDE_v3_to_v5.md index 62a683f27..7f45d39a8 100644 --- a/OneSignalExample/Assets/OneSignal/MIGRATION_GUIDE_v3_to_v5.md +++ b/OneSignalExample/Assets/OneSignal/MIGRATION_GUIDE_v3_to_v5.md @@ -250,7 +250,7 @@ The debug namespace is accessible via `OneSignal.Debug` and provides access to d - We will be introducing JWT in a follow up release # Troubleshooting - +## Android ``` Assets/OneSignal/Example/OneSignalExampleBehaviou.cs: error CS0246: The type or namespace name '...' could not be found (are you missing a using directive or an assembly reference?) ``` @@ -283,4 +283,13 @@ Execution failed for task ':launcher:mergeReleaseJavaResource'. 1. Go to **Player Settings** and click the Android Tab. Under **Publishing Settings**, enable the following: - Custom Main Gradle Template - Custom Gradle Properties Template -2. Resolve Android dependencies with EDM4U at **Assets > External Dependency Manager > Android Resolver > Force Resolve** \ No newline at end of file +2. Resolve Android dependencies with EDM4U at **Assets > External Dependency Manager > Android Resolver > Force Resolve** + +## iOS +**Build error** +``` +'/Users/.../Library/Developer/Xcode/DerivedData/Unity-iPhone-.../Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/OneSignalXCFramework/OneSignalCore/OneSignalCore.framework/OneSignalCore' 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/.../Library/Developer/Xcode/DerivedData/Unity-iPhone-.../Build/Products/ReleaseForRunning-iphoneos/XCFrameworkIntermediates/OneSignalXCFramework/OneSignalCore/OneSignalCore.framework/OneSignalCore' for architecture arm64 +``` + +1. For each target, select the **Build Settings** tab +2. Set **Enable Bitcode** to **No** \ No newline at end of file diff --git a/OneSignalExample/Assets/OneSignal/README.md b/OneSignalExample/Assets/OneSignal/README.md index c742bb8da..1fafb1dfc 100644 --- a/OneSignalExample/Assets/OneSignal/README.md +++ b/OneSignalExample/Assets/OneSignal/README.md @@ -119,6 +119,8 @@ After building in Unity and exporting the XCode project follow these steps: 6. **App Groups** should now be provisioned for you going forward for your iOS bundle id, even on clean builds. +7. Make sure all **Targets** have **Enable Bitcode** set to **No** in **Build Settings**. + ### Android Most of the Android setup was already handled during installation! diff --git a/README.md b/README.md index f9b472682..eeca06610 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,8 @@ After building in Unity and exporting the XCode project follow these steps: 6. **App Groups** should now be provisioned for you going forward for your iOS bundle id, even on clean builds. +7. Make sure all **Targets** have **Enable Bitcode** set to **No** in **Build Settings**. + ### Android In the Unity editor: diff --git a/com.onesignal.unity.ios/Editor/BuildPostProcessor.cs b/com.onesignal.unity.ios/Editor/BuildPostProcessor.cs index b61eace91..ff0784208 100644 --- a/com.onesignal.unity.ios/Editor/BuildPostProcessor.cs +++ b/com.onesignal.unity.ios/Editor/BuildPostProcessor.cs @@ -111,6 +111,8 @@ public void OnPostprocessBuild(BuildReport report) { // Add the service extension AddNotificationServiceExtension(); + DisableBitcode(); + // Save the project back out File.WriteAllText(_projectPath, _project.WriteToString()); } @@ -191,6 +193,7 @@ private void AddNotificationServiceExtension() { _project.SetBuildProperty(extensionGuid, "SWIFT_VERSION", "5.0"); _project.SetBuildProperty(extensionGuid, "ARCHS", "arm64"); _project.SetBuildProperty(extensionGuid, "DEVELOPMENT_TEAM", PlayerSettings.iOS.appleDeveloperTeamID); + _project.SetBuildProperty(extensionGuid, "ENABLE_BITCODE", "NO"); _project.AddBuildProperty(extensionGuid, "LIBRARY_SEARCH_PATHS", $"$(PROJECT_DIR)/Libraries/{PluginLibrariesPath.Replace("\\", "/")}"); @@ -282,6 +285,20 @@ private void ExtensionAddPodsToTarget() { File.WriteAllText(podfilePath, podfile); } + + private void DisableBitcode() { + // Main + var targetGuid = _project.GetMainTargetGuid(); + _project.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO"); + + // Unity Tests + var unityTests = _project.TargetGuidByName(PBXProject.GetUnityTestTargetName()); + _project.SetBuildProperty(unityTests, "ENABLE_BITCODE", "NO"); + + // Unity Framework + var unityFramework = _project.GetUnityFrameworkTargetGuid(); + _project.SetBuildProperty(unityFramework, "ENABLE_BITCODE", "NO"); + } } } #endif \ No newline at end of file