2

This question has been asked no less than 17 times previously and to my great surprise, has never been answered! It has been closed, marked as duplicate and used to solve all manner of unrelated problems. I still cannot find an answer to the actual question in the title.

What seems to happen is that someone unfamiliar with Android runs a program, triggers an error, and gets a series of LogCat error messages. At the front of the LogCat trace appears the above, which they promptly post here. It is completely unrelated to the problem they are interested in solving. Once their problem is solved, they go away. The most popular answer of this kind is here: error opening trace file: No such file or directory (2).

My question is: what exactly does this message in LogCat actually mean? When does it happen, why does it happen, and is there anything I can (reasonably) do to make it go away? [My apps may have other errors, but they are not relevant here.]

Please do not vote to close this question as a duplicate unless or until you can point to another question that provides a sufficient explanation of this actual error message.


It should be said that we are developers (of course) writing code for the Android platform (of course) and we make extensive use of the Log class in our code. It seems that this message appears somewhere after the program starts and somewhere before the first use of the Log class.

The obvious answer would be that Log is expecting to find a specific folder or path, which happens not to exist. The answer may simply be to ensure that path exists, if we knew what it was or where it is set. We're using ADT, as it happens.


So I picked a small app at random and ran it. Here is the LogCat.

05-23 18:22:10.948: D/dalvikvm(27917): Late-enabling CheckJNI 05-23 18:22:11.057: E/Trace(27917): error opening trace file: No such file or directory (2) 05-23 18:22:11.590: D/libEGL(27917): loaded /system/lib/egl/libEGL_mali.so 05-23 18:22:11.598: D/libEGL(27917): loaded /system/lib/egl/libGLESv1_CM_mali.so 05-23 18:22:11.613: D/libEGL(27917): loaded /system/lib/egl/libGLESv2_mali.so 05-23 18:22:11.677: D/OpenGLRenderer(27917): Enabling debug mode 0

There are no calls to Log in this one. It's just Hello World.

Community
  • 1
  • 1
david.pfx
  • 10,520
  • 3
  • 30
  • 63
  • Do you the code is causing the problem? Error seems that your apps are trying to access the file / directory which is not existing. – FrozenFire May 23 '14 at 04:01
  • No, not our apps. See edit. – david.pfx May 23 '14 at 05:36
  • I get this error on 4.0 and above,Don't know why! – dd619 May 23 '14 at 05:38
  • Can you provide us a sample code to replicate this error? Even starts with a new android project with simple Log fail? e.g. `import android.util.Log;` => //at onCreate() `Log.w(main.class.getName(),"Hello");` – FrozenFire May 23 '14 at 05:52
  • @FrozenFire: It's the same on every project, including one with no Log calls. See edit. – david.pfx May 23 '14 at 09:12
  • Are you using eclipse right? Did you tried to update/re-install it? – FrozenFire May 23 '14 at 09:57
  • @FrozenFire: Yes, Eclipse 4.2.1 with updates. No I won't reinstall it unless it's actually broken. The pain is not worth the gain. I'd just like someone to say exactly what that very common error message actually means, and what can be done about it. – david.pfx May 23 '14 at 14:37
  • 1
    The error message comes from the systrace code. It indicates that your device doesn't support systrace tracing. You can ignore it. Refer: http://stackoverflow.com/questions/19225602/app-cant-be-opened-with-the-error-in-opening-trace-file – FrozenFire May 26 '14 at 01:09

1 Answers1

1

The answer is: this is a red herring. Ignore it.

There is a perfectly good answer here, which I repeat.

The error message comes from the systrace code. It indicates that your device doesn't support systrace tracing. You can ignore it.

Log message is generated on line 172 of (android.googlesource.com/platform/system/core/+/jb-mr2-release/… . – fadden Aug 30 '13 at 4:32

The source code link is here.

Thanks to @FrozenFire and @Fadden.

Community
  • 1
  • 1
david.pfx
  • 10,520
  • 3
  • 30
  • 63