Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report fields in 5.8.2 #857

Closed
MarkRS-UK opened this issue Jun 5, 2021 · 14 comments
Closed

Report fields in 5.8.2 #857

MarkRS-UK opened this issue Jun 5, 2021 · 14 comments
Labels

Comments

@MarkRS-UK
Copy link

I'm feeling a bit dense because this looks like it ought to be easy, but I can't work it out.
I've just updated to 5.8.2 and see that things are quite different from 5.7.0.

I have made the adjustments I can understand, and I am getting crash notification, but there's no data.

My code is

class MyApp : BaseApplication() {
    override fun attachBaseContext(base: Context) {
        super.attachBaseContext(base)

        initAcra {
            buildConfigClass = BuildConfig::class.java
            reportFormat = StringFormat.JSON
            httpSender {
                uri = "myUrl"
                httpMethod = HttpSender.Method.POST
            }
        }
    }
}

Previously I had specified the fields I want with

@ReportsCrashes(customReportContent = {
    ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME <etc> }

but this no longer works and I can't work out how to specify the fields I want. I can add the "customReportFields" property in the iniAcra block bu can't for the life of me work out how to specify the fields. And I'm not even sure if this is what's causing my problem.
Fault or operator error?

@F43nd1r
Copy link
Member

F43nd1r commented Jun 5, 2021

things are quite different from 5.7.0

@ReportsCrashes is Acra 4 style

I can add the "customReportFields" property in the iniAcra block bu can't for the life of me work out how to specify the fields

initAcra {
    reportContent = listOf(ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ...)
}

But you should receive default data when not specifying report content.

@MarkRS-UK
Copy link
Author

Thanks for the quick response.

Did "@ReportCrashes" still work in 5.7? It seemed to here.

When I use the "listOf" approach, Android Studio marks it as a bug, complaining

Type mismatch.
Required: Array<out ReportField>
Found: List<ReportField>

I have tried it was an array(List) and it complains that it doesn't want "kotlin.collections.ArrayList<???>"
I've put it in the iniAcra block as you have, after my reportFormat line.

@F43nd1r
Copy link
Member

F43nd1r commented Jun 5, 2021

Right, sorry. It's arrayOf not listOf

@F43nd1r
Copy link
Member

F43nd1r commented Jun 5, 2021

Did "@ReportCrashes" still work in 5.7? It seemed to here.

No. @ReportsCrashes was replaced by @AcraCore and @Acra<module> in 5.0. If you were still using @ReportsCrashes you must've had ACRA 4 on the classpath.

@MarkRS-UK
Copy link
Author

Right, sorry. It's arrayOf not listOf

Ahah! Yes, that does it, thanks. Unfortunately that doesn't seem to be my problem. Still getting an empty crash report.

@F43nd1r
Copy link
Member

F43nd1r commented Jun 5, 2021

Which backend are you using?

@MarkRS-UK
Copy link
Author

My own php code, simply collecting the delivered json and putting it in a field of a table.
It's a long time since I wrote that so I'll check it closely, but I'm not sure that's the issue.

@F43nd1r
Copy link
Member

F43nd1r commented Jun 5, 2021

Is the report an empty json object or completely blank? You can also check if the report file is blank while it is on your device by turning off the internet connection and checking data/data/yourpackage/yourapp_ACRA-approved

@MarkRS-UK
Copy link
Author

MarkRS-UK commented Jun 6, 2021

I don't know what (specifically) changed, but now it's fine.
I suspect (php) changes on the server have contributed, but are not the whole story. I'm pretty sure I had 5.7 not 5.4, and the change to 5.8(.2) is when this surfaced. However, all now good
Incidentally I can't see anything in the device filesystem. In that location it tells me "run as: package not debuggable". The only time I'm using acra is when the code is not debuggable (not obfusticated), because the rest of the time the device is plugged in to my computer and I see the crash dump that way.
Thank you for your help.

@F43nd1r
Copy link
Member

F43nd1r commented Jun 6, 2021

The file location is protected. Not being able to read it in production is intentional for security.

Good you solved it.

@MarkRS-UK MarkRS-UK reopened this Jun 11, 2021
@MarkRS-UK
Copy link
Author

Hi, me again,
The problem has re-occurred and I've found that the immediate cause is that ACRA is sending XML not JSon.
I am getting just the fields I specified so my initAcra block does appear to be the only thing required to start it (which looks a bit odd to me), so I'm still stumped :(

@MarkRS-UK
Copy link
Author

PS I have updated to 5.8.3, but I don't s'pose that would've made any difference.

@F43nd1r
Copy link
Member

F43nd1r commented Jun 11, 2021

ACRA is sending XML?? We don't even support XML. Is your source code available somewhere?

@MarkRS-UK
Copy link
Author

Really? Ooh, must be something else... Hmm, perhaps I'm not getting enough sleep 😢
Hmm, ok, no, my mistake, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants