Prepare Android Release Build for Appxiom SDK
To ensure accurate monitoring and error reporting in your production app, follow these best practices when preparing your Android release build with Appxiom SDK:
- Exclude log() API from execution in release builds to avoid unnecessary debug data in production.
- Add Proguard rules as specified to prevent obfuscation issues and preserve stacktrace details for error analysis.
Application Class Example
- Java
- Kotlin
public class BlogApp extends Application {
@Override
public void onCreate() {
super.onCreate();
Ax.init(this, appKey, platformKey);
}
}
class BlogApp: Application() {
override fun onCreate() {
super.onCreate()
Ax.init(this, appKey, platformKey)
}
}
Always back up the mapping file for each production build. This file is required to deobfuscate stacktraces in the Appxiom dashboard and accurately analyze production crashes.
Location of mapping file:
project-folder/app/build/outputs/mapping/release/mapping.txt
Frequently Asked Questions (FAQ)
Q: Why should I exclude log() API from release builds?
A: This AP is intended for debugging and development. Excluding it from release builds ensures that only relevant production data is reported and avoids unnecessary debug logs in your production environment.
Q: What Proguard rules are required for Appxiom SDK?
A: You must add the rules specified in the Proguard configuration guide to prevent obfuscation of Appxiom SDK classes and annotations, and to preserve stacktrace details.
Q: Why is backing up the mapping file important?
A: The mapping file is essential for deobfuscating stacktraces, allowing you to trace errors and crashes back to your original source code in production.
Q: Where is the mapping file located?
A: The mapping file is generated at project-folder/app/build/outputs/mapping/release/mapping.txt after each release build.
Q: What if I forget to back up the mapping file?
A: Without the mapping file, you will not be able to deobfuscate stacktraces for that build, making crash analysis much more difficult.
Q: Can I automate mapping file backup?
A: Yes, you can add scripts to your CI/CD pipeline to automatically archive mapping files after each release build.
Q: Are there any other best practices for release builds?
A: Always test your release build for monitoring and reporting accuracy, and review the Appxiom SDK release notes for any new requirements.