Android Question No space left on device

Douglas Farias

Expert
Licensed User
Longtime User
hi i m trying to take a picture but i have a mensage No space left on device
but have 580mb free on my sd 1 and 200mb on sd 2 i dont understand o_O
my phone have 187mb free with no sd cards too
i m using File.DirRootExternal

B4X:
Sub Camera1_PictureTaken (Data() As Byte)
    Dim filename As String = "1.jpg"
    Dim dir As String = File.DirRootExternal
    mp.Load(File.DirAssets, "click.wav")
    mp.Play
    camEx.SavePictureToFile(Data, dir, filename)
   
    Dim Phone As Phone
    Dim i As Intent
    i.Initialize("android.intent.action.MEDIA_SCANNER_SCAN_FILE", _
        "file://" & File.Combine(dir, filename))
    Phone.SendBroadcastIntent(i)
   
    cameras.Visible = False
    flash1.Visible = False
    tirarfoto.Visible = False
    trocarcamera.Visible = False
    menucamera.Visible = False
    camEx.Release
   
    ToastMessageShow("Imagem Salva" & CRLF  & "Tamanho da imagem: " & File.Size(dir, filename), True)

    puxafoto
   
End Sub

LOG
B4X:
LogCat connected to: B4A-Bridge: alps S6-123456789026263
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (service1) Create **
** Service (service1) Start **
Connected to B4A-Bridge (Wifi)
Installing file.
** Activity (main) Pause, UserClosed = false **
PackageAdded: package:click.fight.vallow
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (perfil) Create, isFirst = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
cameraexclass_release (java line: 440)
java.lang.NullPointerException
    at click.fight.vallow.cameraexclass._release(cameraexclass.java:440)
    at click.fight.vallow.perfil._activity_pause(perfil.java:439)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
    at click.fight.vallow.perfil.onPause(perfil.java:221)
    at android.app.Activity.performPause(Activity.java:4577)
    at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1201)
    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2740)
    at android.app.ActivityThread.performPauseActivity(ActivityThread.java:2709)
    at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2687)
    at android.app.ActivityThread.access$800(ActivityThread.java:127)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1186)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4508)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
    at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (perfil) Resume **
90
[Height=240, IsInitialized=false, Width=320
]
[Height=240, IsInitialized=false, Width=320
]
90
[Height=240, IsInitialized=false, Width=320
]
[Height=240, IsInitialized=false, Width=320
]
java.io.FileNotFoundException: /mnt/sdcard/1.jpg: open failed: ENOSPC (No space left on device)
    at libcore.io.IoBridge.open(IoBridge.java:448)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
    at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:348)
    at click.fight.vallow.cameraexclass._savepicturetofile(cameraexclass.java:449)
    at click.fight.vallow.perfil._camera1_picturetaken(perfil.java:470)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
    at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:858)
    at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:815)
    at click.fight.vallow.cameraexclass._camera_picturetaken(cameraexclass.java:78)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:173)
    at anywheresoftware.b4a.BA$2.run(BA.java:283)
    at android.os.Handler.handleCallback(Handler.java:605)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4508)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
    at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: open failed: ENOSPC (No space left on device)
    at libcore.io.Posix.open(Native Method)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
    at libcore.io.IoBridge.open(IoBridge.java:432)
    ... 23 more
java.io.FileNotFoundException: /mnt/sdcard/1.jpg: open failed: ENOSPC (No space left on device)
 

LucaMs

Expert
Licensed User
Longtime User
You get an error prior to ENOSPC.
cameraexclass_release (java line: 440)
java.lang.NullPointerException
at click.fight.vallow.cameraexclass._release(cameraexclass.java:440)


I do not know which object it refers but you should check that.
 
Upvote 0
Top