prepbgg
prepbgg

Reputation: 3652

Android trace file created but zero bytes long

I am trying to follow the instructions on this page to create a trace file. I can see the file in File Explorer in DDMS and can pull it onto my PC but it is zero bytes long.

Any suggestions as to what I might be doing wrong, please?

Upvotes: 7

Views: 3753

Answers (2)

栉风丶
栉风丶

Reputation: 11

I called Debug.startMethodTracing(); in the Application, and my app has multiple processes. This leads to Debug.stopMethodTracing(); not taking effect.

Only call in the main process to solve this problem.

Upvotes: 1

prepbgg
prepbgg

Reputation: 3652

The problem seems to have been that the stopMethodTracing() call which I had put in the onDestroy() method (as suggested in the Dev Guide) failed to stop the tracing even though I had tried three different means of ending the activity ... rotating the screen, pressing the Home Key and using Taskiller to kill the app.

By moving the stopMethodTracing() elsewhere I now have a trace with data in it!

(The vital clue was that I noticed that LogCat was reporting TRACE STARTED but never reported TRACE STOPPED.)

Upvotes: 9

Related Questions