43

When I attempt to run my application in Eclipse on my device, I've started getting alot of com.android.ddmlib.SyncException: Too many open files exceptions/errors in the console.

Why is this and what does it mean? What can I do to stop this?

Kurru
  • 14,180
  • 18
  • 64
  • 84

5 Answers5

57

Switch DEBUG USB off and on again. It works for me. It seems to be some sort of problem with USB sync when debuggin in my device.

Hope it helps!

Dani bISHOP
  • 1,226
  • 11
  • 18
  • 3
    If anyone doesn't know how to switch DEBUG USB off and on, here's instructions: http://www.groovypost.com/howto/mobile/how-to-enable-usb-debugging-android-phone/ – Ginny Jun 22 '12 at 03:43
  • +1 Yep this worked. "Too many files open" does not necessarily mean faulty code. – hendrix Nov 09 '12 at 14:34
50

Essentially, that means you have a memory problem. More than likely it is a leak.

First restart your phone and verify you are still getting the error. If so you are going to need to start digging in your code and find out where you are leaking!

Need more help? Post some code!

user432209
  • 20,007
  • 10
  • 56
  • 75
  • ah super :-/ Would this even be the case if using "advanced task killer" to terminate the application? I would imagine that would free up the memory? – Kurru Mar 18 '11 at 16:09
  • I'm not familiar with task killers. – user432209 Mar 18 '11 at 21:12
  • 6
    Only restarting phone helps. The above error happens to me sometimes after a serie of debugging. I do not think it is related to memory leaks. The apps work really well. – Yar Jun 10 '12 at 12:39
  • how is it possible to verify that "you have a memory problem" ? Assume I have full root access. – Someone Somewhere Mar 07 '13 at 19:47
  • I got the problem trying to compile to the phone, so, I suppose it isn't a memory leak (at least not of the compiled app, probably rather a OS bug?) – Daniel Nov 12 '13 at 09:05
8

When you install and test your application many times on a phone, you may get this error message.

Unplug the phone from the USB cable and then plug it in again.

Lumis
  • 21,517
  • 8
  • 63
  • 67
0

I started getting this after adding links which started the 'google play' app to link users to my other game apps, e.g.
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=my game"));

when I quit my app, and tried to relaunch it from eclipse, i'd either get the 'too many open files' or i'd get the 'bringing current activity to front' message, which would just reopen the googleplay page I had launched from within my previous application run. it seems that secondary 'google play' intent is hanging on after I quit everything and is preventing the application relaunch from eclipse. unfortunately, just adding browserIntent.finish() from within the app doesn't work, the command (and the suggested (Activity) label fix) isn't accepted.

I didn't have this problem when I linked to my other apps through the web browser, just opening a web page to my app. I may have to switch back to that method.

this link shows a suggestion on quitting an intent started by your main activity, although i'm working on something simpler: How to stop an activity in android using intent?.

Community
  • 1
  • 1
Androidcoder
  • 4,389
  • 5
  • 35
  • 50
0

finally one solution. if you facing problem in instal or uninstall. Simply restart your Device and see magic . :)

Gaurav kumar
  • 796
  • 2
  • 8
  • 25