Android Question 1.png: open failed: ENOENT (No such file or directory)

Status
Not open for further replies.

Shay

Well-Known Member
Licensed User
Longtime User
I upgraded from B4A 6.x to 8.50 and tried to compile and getting the following errors on each file that start with number, such as 1.mp3, 1.png, etc..
why?

java.lang.RuntimeException: Unable to create service takziv.financhick.com.starter: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/Android/data/takziv.financhick.com/files/virtual_assets/1.png: open failed: ENOENT (No such file or directory)
 

HubOlivier

New Member
Licensed User
Hi All,

Same issue with a fresh install (8.50)

I try to compile and run « MyFirstProgram.b4a » in debug mode (galaxy S3 connected by usb) and I get the same error.

Copying updated assets files (1)
java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.MyFirstProgram/files/virtual_assets/main.bal: open failed: ENOENT (No such file or directory)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:169)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at b4a.MyFirstProgram.main.afterFirstLayout(main.java:96)
at b4a.MyFirstProgram.main.access$000(main.java:17)
at b4a.MyFirstProgram.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1209)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1025)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.MyFirstProgram/files/virtual_assets/main.bal: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:409)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:448)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:156)
... 14 more
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
at libcore.io.IoBridge.open(IoBridge.java:393)
... 17 more

Thank you for your help
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
update: as stated by Olivier issue happens on debug mode, not on "Release" mode
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
I moved from 6.x to 8.50, so I am unaware of legacy none legacy mode
I am choosing from the drop down (release / debug, ..) so debug
 
Upvote 0

Eduardo Enri

Member
Licensed User
Same result with several projects even example projects as "AppCompatWithDynamicMenuAndBadge". Only in Debug mode.

Compilation dialog (spanish version IDE):

B4A Versión: 8.50
Parseando código. (0.01s)
Building folders structure. (0.09s)
Compilando código (0.02s)
Compilado código de diseños (0.02s)
Organizando librerías. (1.30s)
Generando el fichero R. (0.64s)
Compilando el código del motor de depuración. (1.02s)
Compilando el código Java generado. (2.14s)
Convirtiendo byte code a dex optimizado. (6.48s)
Empaquetando ficheros. (1.17s)
Copiando los recursos de librerias (0.01s)
Firmando fichero de paquete (clave de depuración) (1.04s)
ZipAlign file. (0.06s)
Instalando archivo al dispositivo. (6.63s)
Device serial: XB011290
Completado con éxito

error log:

Registo conectado a: XB011290
--------- beginning of crash
--------- beginning of main
--------- beginning of system
PackageAdded: package:b4a.example
Copying updated assets files (4)
java.lang.RuntimeException: Unable to create service b4a.example.starter: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.example/files/virtual_assets/1.bal: open failed: ENOENT (No such file or directory)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2771)
at android.app.ActivityThread.access$1800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1386)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.example/files/virtual_assets/1.bal: open failed: ENOENT (No such file or directory)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:169)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at b4a.example.starter.onCreate(starter.java:34)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2761)
... 9 more
Caused by: java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.example/files/virtual_assets/1.bal: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:456)
at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:448)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:156)
... 13 more
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:442)
... 16 more
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
not using legacy debug mode

B4X:
Copying updated assets files (301)
java.lang.RuntimeException: Unable to create service takziv.financhick.com.starter: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/Android/data/takziv.financhick.com/files/virtual_assets/1.mp3: open failed: ENOENT (No such file or directory)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2757)
    at android.app.ActivityThread.access$1800(ActivityThread.java:147)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5253)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/Android/data/takziv.financhick.com/files/virtual_assets/1.mp3: open failed: ENOENT (No such file or directory)
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:169)
    at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
    at takziv.financhick.com.starter.onCreate(starter.java:34)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2747)
    ... 9 more
Caused by: java.io.FileNotFoundException: /storage/emulated/0/Android/data/takziv.financhick.com/files/virtual_assets/1.mp3: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:456)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
    at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:448)
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:156)
    ... 13 more
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
    at libcore.io.Posix.open(Native Method)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
    at libcore.io.IoBridge.open(IoBridge.java:442)
    ... 16 more
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is working now but means that this is a temporary solution.
This is not a temporary solution. It disables a debugger optimization. You can safely use it.

@Shay which device are you using? Does it work if you add this line to the manifest editor:
B4X:
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
?
 
Upvote 0

Eduardo Enri

Member
Licensed User
Certainly Erel, but I think that it is not a definitive solution for me, since I would like to return to the situation previous to the recent update of B4A where this command was not necessary in my project. Would it be possible?. Thanks.
 
Upvote 0

Eduardo Enri

Member
Licensed User
I tried adding this line to the manifiest editor and works too.

B4X:
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)

Thanks!
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
@Erel same for me, simple project, 1 image in layout
B4X:
Logger connected to: FBNKFX018701
--------- beginning of system
--------- beginning of main
PackageAdded: package:b4a.example
Copying updated assets files (2)
java.lang.RuntimeException: Unable to create service b4a.example.starter: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.example/files/virtual_assets/camera2.png: open failed: ENOENT (No such file or directory)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2757)
    at android.app.ActivityThread.access$1800(ActivityThread.java:147)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5253)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.example/files/virtual_assets/camera2.png: open failed: ENOENT (No such file or directory)
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:169)
    at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
    at b4a.example.starter.onCreate(starter.java:34)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2747)
    ... 9 more
Caused by: java.io.FileNotFoundException: /storage/emulated/0/Android/data/b4a.example/files/virtual_assets/camera2.png: open failed: ENOENT (No such file or directory)
    at libcore.io.IoBridge.open(IoBridge.java:456)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:87)
    at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:448)
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:156)
    ... 13 more
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
    at libcore.io.Posix.open(Native Method)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
    at libcore.io.IoBridge.open(IoBridge.java:442)
    ... 16 more
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
just saw this..

This is not a temporary solution. It disables a debugger optimization. You can safely use it.

@Shay which device are you using? Does it work if you add this line to the manifest editor:
B4X:
AddPermission(android.permission.WRITE_EXTERNAL_STORAGE)
?

I am using Asus tablet 7''
yes if adding this line to mainfest it solve the issue
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
@Erel do I need to use the above solution or I can use the mainfest line for now?
and are you going to issue new b4a version soon with the fix?
 
Upvote 0
Status
Not open for further replies.
Top