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.


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):


error log:

 
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..


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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…