Last active
September 18, 2015 12:23
-
-
Save kibotu/121e5ea6b9d0ae76ff89 to your computer and use it in GitHub Desktop.
crashlytics hack to set different version name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void setupCrashlytics(@NotNull final Activity activity) { | |
final Crashlytics crashlytics = new Crashlytics(); | |
// hack to set fully classified version name @see gradle task.canonicalReleaseVersionName | |
try { | |
final Field versionNameField = CrashlyticsCore.class.getDeclaredField("versionName"); | |
versionNameField.setAccessible(true); | |
versionNameField.set(crashlytics.core, Build.getValue(CANONICAL_VERSION_NAME)); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
Fabric.with(activity, crashlytics); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment