F43nd1r/Acrarium

Acrarium showing ACRA version by default on reports tab, not app version

Closed this issue ยท 2 comments

Hey @F43nd1r ๐Ÿ‘‹ - I think this line here is causing me problems, and I'm curious for your opinion:

val versionName: String = buildConfig?.findString("VERSION_NAME") ?: jsonObject.findString(ReportField.APP_VERSION_NAME.name) ?: "N/A"

What I see then is "5.7.0" (current ACRA version sending this report) on Acrarium on my bugs / reports tabs for the app,

Screenshot from 2022-10-10 17-20-12

I think it is because this is in the report, leading to the line of code above:

APP_VERSION_NAME 2.15.6

... (much later) ...

BUILD_CONFIG  BUILD_TYPE release
                            DEBUG false
                            LIBRARY_PACKAGE_NAME org.acra.dialog
                            VERSION_CODE -1
                            VERSION_NAME 5.7.0

I suppose that is because it's the :acra process sending the report?

Would it be okay to reverse those first two in the optional value chain, like so?

        val versionName: String = buildConfig?.findString("APP_VERSION_NAME") ?: jsonObject.findString(ReportField.VERSION_NAME.name) ?: "N/A"

For the issue itself, please make sure this is not a duplicate of #319.
Regarding switching those two statements: that would be possible, but the current order was chosen because buildconfig values are either always or never available, whereas appVersionName relies on package manager being available after the app crashed, which is most of the time but not always the case.

Ahhh - you are right, I'm sorry I did not see that duplicate.
I not only have the exact same issue as the one you linked - and for the same reason - but just sharing this for a smile - it is not even so subtle.

I am explicitly fully specifying the wrong class. ๐Ÿคฆ

            .withBuildConfigClass(org.acra.dialog.BuildConfig::class.java)

Thanks