Skip to content

Commit

Permalink
Merge pull request #118 from embrace-io/alyssa/unity/extra-notes-12-24
Browse files Browse the repository at this point in the history
Ancillary necessary notes
  • Loading branch information
alyssa-embrace authored Dec 13, 2024
2 parents f495773 + 46606e8 commit 08f65d0
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 23 deletions.
13 changes: 11 additions & 2 deletions docs/unity/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@ sidebar_position: 4
---

# Unity SDK Changelog
## 2.1.1
*November 26, 2024*
## 2.1.2
*December 12, 2024*
:::warning Info
Our Apple SDK and the Unity iOS SDK use Swift, which has a known issue with the current Unity build pipeline. To handle this issue, after creating your XCode project, add a Dummy Swift file to the UnityFramework target. This will adjust the linker pipeline to invoke Swift appropriately.

For further information, please refer to this discussion: https://github.com/CocoaPods/CocoaPods/issues/11960
:::
* Upgrade of Embrace iOS dependency to 6.6.0
* Removal of automated scoped registry functionality
* Removal of integration guide steps in lieu of documentation
* Patch of extraneous embedding of iOS framework elements
* Patch of StopSpan error code handling
* Patch of Android Crash Handling when dealing with default `config.json` values

## 2.1.1
*November 26, 2024*
* Restoration of meta files and patch to local asset path issues

## 2.1.0
Expand Down
2 changes: 1 addition & 1 deletion docs/unity/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sidebar_position: 0

Embrace's Unity SDK lets you bring the deep, introspective and native debugging power of Embrace into your Unity game or application.

We test our SDK on all Unity LTS versions 2020.3.15f1 and newer. Each Unity release varies and all Unity projects are a little different, so don't hesitate to reach out to us for support during the integration process.
We test our SDK on Unity LTS versions 2021.3.41f1 and newer. Each Unity release varies and all Unity projects are a little different, so don't hesitate to reach out to us for support during the integration process.

This documentation is split into two sections:

Expand Down
8 changes: 4 additions & 4 deletions docs/unity/integration/configure-embrace-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ On Android, Unity builds are handled by Gradle. To integrate Embrace, we'll be a

# Minimum Gradle and Android Gradle Plugin Versions

To use the Embrace Unity SDK you must be using:
1. At least version `6.5.1` of Gradle
1. At least version `4.0.0` of the Android Gradle Plugin (classpath `com.android.tools.build:gradle`)
To use the latest version of the Embrace Unity SDK you must be using:
1. At least version `7.5.1` of Gradle
1. At least version `7.4.2` of the Android Gradle Plugin (classpath `com.android.tools.build:gradle`)

If your version of Unity does not come with supported versions of Gradle and AGP, you may need to upgrade them. See [this page](https://docs.unity3d.com/Manual/android-gradle-overview.html) for more information. Alternatively, see the instructions on [this page](https://developers.google.com/admob/unity/gradle) regarding how to upgrade these inside Unity.
If your version of Unity does not come with supported versions of Gradle and AGP, you may need to upgrade them. See [this page](https://docs.unity3d.com/Manual/android-gradle-overview.html) for more information. Alternatively, see the instructions on [this page](https://developers.google.com/admob/unity/gradle) regarding how to upgrade these inside Unity. Please note that in upgrading, you may have to update values in the generated template files we require as they may still point to the older values.

# External Dependency Manager - Android Resolver

Expand Down
2 changes: 1 addition & 1 deletion docs/unity/integration/configure-embrace-ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Now when you build and run your project, our editor script will use those values

## Known Issues

Our Apple SDK and the Unity iOS SDK use Swift, which has a known issue with the current Unity build pipeline. To handle this issue, after creating your XCode project, add a Dummy Swift file to the UnityFramework target. This will adjust the linker pipeline to invoke Swift appropriately.
Our Apple SDK and the Unity iOS SDK use Swift, which has a known issue with the current Unity build pipeline. To handle this issue, after creating your XCode project, add a Dummy Swift file to the UnityFramework target by right clicking the `Unity-iPhone` xcode project in the Project Navigator and selecting the `New File from Template` option. Make sure to add the file to BOTH the game target AND the UnityFramework target. Then, make sure to create the bridging heading. There's no need to add any code. This will adjust the linker pipeline to invoke Swift appropriately.

For further information, please refer to this discussion: https://github.com/CocoaPods/CocoaPods/issues/11960

Expand Down
2 changes: 1 addition & 1 deletion docs/unity/integration/linking-embrace.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: Linking Embrace with your application is quick and easy.

To install Embrace, download our latest SDK below.

[Download Embrace 2.1.1 for Unity](https://downloads.embrace.io/EmbraceSDK_2.1.1.unitypackage)
[Download Embrace 2.1.2 for Unity](https://downloads.embrace.io/EmbraceSDK_2.1.2.unitypackage)

Once downloaded, import the Unity Package by selecting Assets -> Import Package -> Custom Package.

Expand Down
13 changes: 0 additions & 13 deletions docs/unity/integration/session-reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ process we're going to follow to collect our first session is:

1. [**Import the Embrace module**](/unity/integration/session-reporting#import-embrace)
1. [**Add a start call to the Embrace SDK**](/unity/integration/session-reporting#add-a-start-call)
1. [**End the Startup Moment**](/unity/integration/session-reporting#end-the-startup-moment)
1. [**Build and run our application**](/unity/integration/session-reporting#build-and-run-your-application)
1. Verify Embrace started via the logs
1. [**Trigger a session upload**](/unity/integration/session-reporting#trigger-a-session-upload)
Expand Down Expand Up @@ -60,18 +59,6 @@ It is important that this call be made as early as possible in the lifecycle of

:::

## End the Startup Moment

Finally, make sure to end the special "startup" moment that Embrace uses to track app launch performance. You can end this moment anywhere you choose. We recommend placing the call as close to the point that your UI is ready for use as possible, as doing so will give you the most accurate picture of the performance your users are experiencing with app launch.

```cs
Embrace.Instance.EndAppStartup();
```

:::info A Note On Ensuring the Startup Moment Ends
This moment is used to track both launch performance and launch abandonment. The latter is the number of users who close the app before the launch finishes. To correctly track this, it is critical that all code paths end the startup moment eventually. For example, if your app can launch via a push notification, ensure that path also ends the startup moment or you may see inaccurate abandonment data.
:::

## Build and Run Your Application

You're now ready to build and run your application. Assuming the app launches correctly, pay attention to the system logging and look for Embrace to print out its version number.
Expand Down
11 changes: 11 additions & 0 deletions docs/unity/upgrade-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ For usage, please refer to our documentation on [Traces](/unity/features/traces.

Please refer to the [list](/android/upgrading/#remove-deprecated-properties-from-your-buildgradle) on the Embrace Android SDK Upgrade Guide for now deprecated `build.gradle` properties.

## AGP Version dependency has been bumped

Unity has updated the internal android build tools, Gradle plugin, and Android Gradle plugin. We target those new values as our minimums on the Embrace Android SDK, and therefore also the Embrace Unity SDK on Android. For further information, please look at Unity's documentation [here](https://docs.unity3d.com/2021.3/Documentation/Manual/android-gradle-overview.html). Specific patch versions of Unity with this support differ by major Unity version; make sure to double check your version of Unity against the correct documentation.

Please note that in upgrading, you may have to update values in the generated template files we require as they may still point to the older values. Please refer to the link to Unity's documentation above regarding supported Android Gradle versions for what these should be.

## Swift Library Workaround
Currently the latest version of Xcode and Unity's iOS build pipeline have an issue where including a Swift library (such as the Embrace Apple SDK) does not result in Xcode invoking its linker toolchain correctly. This can block builds and will generally involve messages mentioning symbols such as `swift_FORCE_LOAD_$_swiftCompatibility`. The issue is rather recent, and listed [here](https://forums.developer.apple.com/forums/thread/762854).

The easiest solution to this is to add a Dummy Swift file in the exported Xcode project out of Unity by right clicking the `Unity-iPhone` xcode project in the Project Navigator and selecting the `New File from Template` option. When doing this make sure to add the Swift file to the UnityFramework in Xcode. Make sure to add the file to BOTH the game target AND the UnityFramework target. Then, make sure to create the bridging heading. There's no need to add any code. The sole purpose of the file is to provide Xcode the necessary hints so that it invokes its toolchain correctly.

## Some features still have yet to be migrated
- Replacement for `EndAppStartup` planned for both Embrace Android and Embrace Apple SDKs
- Please refer to the Embrace Apple SDK [Upgrade Guide](/ios/open-source/upgrade-guide/) for as of yet unsupported features on iOS
2 changes: 1 addition & 1 deletion embrace.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"version": "1.26.1"
},
"unity_android": {
"version": "6.8.3"
"version": "6.14.0"
}
}

0 comments on commit 08f65d0

Please sign in to comment.