A plugin to simplify the integration of Amplitude iOS and Android SDKs into your Unity project. This respository also contains a sample project with the Unity plugin integrated.
Please see our installation guide for instructions on installing and using our Unity Plugin.
NOTE: If you use proguard for obfuscation, please add following exception to your exception rules file (proguard-android.txt or proguard-rules.pro)
-keep class com.amplitude.unity.plugins.AmplitudePlugin
Click here to view the Unity Plugin Changelog.
Our com.amplitude.android-sdk is a transitive library, it doesn't include any other dependencies by itself. Other dependencies for com.amplitude.android-sdk are placed into Assets/Plugins/Android. We only use okhttp, the other dependencies you see are ones okhttp depends on (e.g. okio, jetbrain).
If by any chance you have okhttp included in your project, feel free to choose not to include okhttp and its related dependencies by unchecking them.
Some users use unity-jar-resolver themselves. When they force resolve dependencies, it will clean up Amplitude related jars. For this case, what you would need to do is to declare those dependencies in your *Dependency.xml file.
Please add our native dependencies under androidPackage tag.
<androidPackage spec="com.amplitude:android-sdk:2.25.2">
<repositories>
<repository>https://maven.google.com</repository>
</repositories>
</androidPackage>
<androidPackage spec="com.squareup.okhttp3:okhttp:4.2.2">
<repositories>
<repository>https://maven.google.com</repository>
</repositories>
</androidPackage>
Amplitude SDK depends on okhttp library, since okhttp v3.13, they require android 5.0, Android Lollipop (API 21). Read details
We do not restrict which okhttp version to use, you can downgrade the okttp version to be lower than 3.13 to make it work for API 19, 20.
If you import library by copying the jar file, you can downgrade okhttp library by replacing it with a version < 3.13. If you use google dependency resolver, update the dependency version for okhttp in *Dependency.xml file.
If you have any problems or issues over our SDK, feel free to create a github issue or submit a request on Amplitude Help.
