Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio static = libcore.io.Posix ENOENT exception

I am trying to run my app on a emulator. It used to work but now it does not load properly. The debug error I get is:

static = libcore.io.Posix
  Exception = {android.system.ErrnoException@3564}

When I right click on the Exception line and Copy Value I get:

  android.system.ErrnoException: stat failed: ENOENT (No such file or directory)

My app does not have any file io programed so the exception must relate to something the system requires.

Looking back in the LogCat I get a match for ENOENT, several lines before are:

com.google.process.location W/art? Suspending all threads took: 7.795ms
com.google.process.location I/art? Background partial concurrent mark sweep GC freed 2094(165KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 3MB/5MB, paused 9.486ms total 274.854ms
com.google.process.location I/GCoreUlr? DispatchingService.onCreate()
com.google.process.location I/GCoreUlr? WorldUpdater received intent Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingService (has extras) } with receiverAction android.location.PROVIDERS_CHANGED
com.google.process.location E/copresGcore? Couldn't load settings: /data/data/com.google.android.gms/files/copresence_settings: open failed: ENOENT (No such file or directory)

I cannot see what file it cannot read/write to. I do not have any file IO programmed but I am using sqlite3, maybe to system cannot find the database file.

To get some relief from this error for a while I created a new project in Android Studio. Shut down AS and copied my source files into the new AS project. Then when I ran the new project, the error had gone. It came back after several hours of programing and editing.

I have looked for solutions on the internet for 2 days now without success. Any help would be appreciated.

Further details:
If I run (not debug) the app on the emulator or the device it works.
If I run/debug on the emulator or the device it crashes with the same libcore exception.
Part conclusion: it is something to do with debugging.

I thought I had come across a workaround:

  1. I closed the existing AVD
  2. I ran the AVD from the AS AVD manager
  3. I re-installed the app: adb install -r C:\Users...\app-debug.apk
  4. I ran the app from AS by pushing the debug button

This worked once then the libcore error appeared. This workaround is not good, even if it worked, as the edit run/cycle is too long.

I think the only way is to breakpoint the Google source to determine what it is excepting on. I spent much time searching the internet to find out how to do this without success. If anybody can point me to relevant articles I would be grateful.

like image 224
Bill_NZ Avatar asked Jan 27 '15 04:01

Bill_NZ


1 Answers

I raised Android Open Source Project issue 126510. The comments by [email protected] gave the answer. I had turned on "Java Exception Breakpoints" with "Any exception" checked. This caused the problem when I restarted the project. I seems that applications may use exception handling for not just errors. So if you use "Any exception" be sure to remember to disable it again ASAP.

example of dialog

like image 133
Bill_NZ Avatar answered Oct 15 '22 12:10

Bill_NZ