Skip to main content

ProGuard Rules

ProGuard optimizes and obfuscates Android release builds. Add these rules to ensure Apptrove SDK functions correctly.

Step 1: Add ProGuard Rules

Create Platforms/Android/proguard-rules.pro:

# Apptrove SDK Rules
-keep class com.trackier.sdk.** { *; }
-keepclassmembers class com.trackier.sdk.** { *; }

# Google Play Services
-keep class com.google.android.gms.common.ConnectionResult {
int SUCCESS;
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient {
com.google.android.gms.ads.identifier.AdvertisingIdClient$Info getAdvertisingIdInfo(android.content.Context);
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info {
java.lang.String getId();
boolean isLimitAdTrackingEnabled();
}

# Install Referrer
-keep public class com.android.installreferrer.** { *; }

# Kotlin
-keep class kotlin.Metadata { *; }
-keep class kotlin.** { *; }
-dontwarn kotlin.**

Step 2: Configure .csproj

<PropertyGroup Condition="$(TargetFramework.Contains('-android')) and '$(Configuration)' == 'Release'">
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<AndroidEnableProguard>true</AndroidEnableProguard>
<AndroidProguardConfigFile>Platforms\Android\proguard-rules.pro</AndroidProguardConfigFile>
</PropertyGroup>

Step 3: Test Release Build

dotnet build -c Release -f net10.0-android

Troubleshooting

IssueSolution
SDK not working in releaseVerify all ProGuard rules are added
Build errorsCheck ProGuard syntax
Tracking data missingTemporarily disable ProGuard to isolate issue

For support, contact support@trackier.com.