actually, the problem is that either /sys/kernel/debug is not mounted, or that the running kernel has no ftrace tracers compiled in so that /sys/kernel/debug/tracing is unavailable. this is the code throwing the error (platform_frameworks_native/libs/utils/trace.cpp):

void tracer::init() {
    mutex::autolock lock(smutex);

    if (!sisready) {
        add_sysprop_change_callback(changecallback, 0);

        const char* const tracefilename =
        stracefd = open(tracefilename, o_wronly);
        if (stracefd == -1) {
            aloge("error opening trace file: %s (%d)", strerror(errno), errno);
            senabledtags = 0;   // no tracing can occur
        } else {

        android_atomic_release_store(1, &sisready);

the log message could definitely be a bit more informative.


you will not have access to your real sd card in emulator. you will have to follow the steps in this tutorial to direct your emulator to a directory on your development environment acting as your sd card.


i didn't want to reinstall everything because i have so many sdk versions installed and my development environment is set up just right. getting it set up again takes way too long.

what worked for me was deleting, then re-creating the android virtual device, being certain to put in a value for sd card size (i used 200 mib).

screenshot of the avd creation screen

additional information:

while the above does fix the problem temporarily, it is recurring. i just tried my application within android studio and saw this in the output log which i did not notice before in eclipse:

"/applications/android" -avd avd_for_nexus_s_by_google -netspeed full -netdelay none

warning: data partition already in use. changes will not persist!
warning: sd card image already in use: /users/[user]/.android/avd/avd_for_nexus_s_by_google.avd/sdcard.img
ko:snapshot storage already in use: /users/[user]/.android/avd/avd_for_nexus_s_by_google.avd/snapshots.img

i suspect that changes to the log are not saving to the sd card, so when logcat tries to access the logs, they aren't there, causing the error message. the act of deleting the avd and re-creating it removes the files, and the next launch is a fresh launch, allowing logcat to access the virtual sd card.


write all your code below this 2 lines:-


it worked for me without re-installing again.


try removing the uses-sdk part form androidmanifest.xml file. it worked for me!

don't use the android virtual device with too low configuration. let it be medium.


i think this is the problem

a little background

traceview is a graphical viewer for execution logs that you create by using the debug class to log tracing information in your code. traceview can help you debug your application and profile its performance. enabling it creates a .trace file in the sdcard root folder which can then be extracted by adb and processed by traceview bat file for processing. it also can get added by the ddms.

it is a system used internally by the logger. in general unless you are using traceview to extract the trace file this error shouldnt bother you. you should look at error/logs directly related to your application

how do i enable it:

there are two ways to generate trace logs:

  1. include the debug class in your code and call its methods such as startmethodtracing() and stopmethodtracing(), to start and stop logging of trace information to disk. this option is very precise because you can specify exactly where to start and stop logging trace data in your code.

  2. use the method profiling feature of ddms to generate trace logs. this option is less precise because you do not modify code, but rather specify when to start and stop logging with ddms. although you have less control on exactly where logging starts and stops, this option is useful if you don't have access to the application's code, or if you do not need precise log timing.

but the following restrictions exist for the above

if you are using the debug class, your application must have permission to write to external storage (write_external_storage).

if you are using ddms: android 2.1 and earlier devices must have an sd card present and your application must have permission to write to the sd card. android 2.2 and later devices do not need an sd card. the trace log files are streamed directly to your development machine.

so in essence the tracefile access requires two things

1.) permission to write a trace log file i.e. write_external_storage and read_external_storage for good measure

2.) an emulator with an sdcard attached with sufficient space. the doc doesnt say if this is only for ddms but also for debug, so i am assuming this is also true for debugging via the application.

what do i do with this error:

now the error is essentially a fall out of either not having the sdcard path to create a tracefile or not having permission to access it. this is an old thread, but the dev behind the bounty, check if are meeting the two prerequisites. you can then go search for the .trace file in the sdcard folder in your emulator. if it exists it shouldn't be giving you this problem, if it doesnt try creating it by adding the startmethodtracing to your app.
i'm not sure why it automatically looks for this file when the logger kicks in. i think when an error/log event occurs , the logger internally tries to write to trace file and does not find it, in which case it throws the error.having scoured through the docs, i don't find too many references to why this is automatically on. but in general this doesn't affect you directly, you should check direct application logs/errors. also as an aside android 2.2 and later devices do not need an sd card for ddms trace logging. the trace log files are streamed directly to your development machine.

additional information on traceview:

copying trace files to a host machine

after your application has run and the system has created your trace files .trace on a device or emulator, you must copy those files to your development computer. you can use adb pull to copy the files. here's an example that shows how to copy an example file, calc.trace, from the default location on the emulator to the /tmp directory on the emulator host machine:

adb pull /sdcard/calc.trace /tmp viewing trace files in traceview to run traceview and view the trace files, enter traceview . for example, to run traceview on the example files copied in the previous section, use:

traceview /tmp/calc note: if you are trying to view the trace logs of an application that is built with proguard enabled (release mode build), some method and member names might be obfuscated. you can use the proguard mapping.txt file to figure out the original unobfuscated names. for more information on this file, see the proguard documentation.

i think any other answer regarding positioning of oncreate statements or removing uses-sdk are not related, but this is android and i could be wrong. would be useful to redirect this question to an android engineer or post it as a bug

more in the docs


it happens because you have not installed the minsdkversion or targetsdkversion in you’re computer. i've tested it right now.

for example, if you have those lines in your manifest.xml:

android:targetsdkversion="17" />

and you have installed only the api17 in your computer, it will report you an error. if you want to test it, try installing the other api version (in this case, api 8).

even so, it's not an important error. it doesn't mean that your app is wrong.

sorry about my expression. english is not my language. bye!

Related Query

More Query from same tag