Android Question I'm Stuck! DirInternal Working on Phone, Not Tablet

Shadow&Max

Active Member
Licensed User
Longtime User
Please note: I've since discovered that it's not the DirInternal issue that's causing this, but instead, accessing the layout files after installation on the tablet. See below for the error log etc.

I'm really stuck. I'm using Erel's KeyValueStore class for a small, persistent database. For two months I've been developing this app and am getting ready to send it out to testers. Up until now, I've been using emulators (Genymotion & AVD stuff) as well as my Moto-X phone, and everything was working properly.

I purchased a cheapie tablet to test, just to be sure, and it's not working at all. The Phone doesn't have an SD card, and neither of course do the emulators.

When I run this on the tablet, which DOES have an SD card, the app immediately dies as I'm calling the KeyValueStore with File.DirInternal in one of the first steps. (After further investigation, it's not that call to DirInternal that's failing, but instead trying to open the bal files)

On the tablet, it's erroring out on the open, saying it cannot find the file on the SD card. I'm not trying to use the SD card. I want to avoid the SD card cause it could be removed and then my data is gone.

Am I accessing the wrong dir??? I only access two in the entire app... File.DirAssets for the icons etc., and File.DirInternal for everything else.

How can I get past this? Until I solve this, I can't release this app, and I really NEED to release this app.

Any help would be appreciated.
 
Last edited:

Shadow&Max

Active Member
Licensed User
Longtime User
java.lang.RuntimeException: java.io.FileNotFoundException: /mnt/sdcard/Android/data/com.twodogapps.gaa/files/virtual_assets/about.bal: open failed: ENOENT (No such file or directory) at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:159)

It appears it's trying to open the layout file for the about screen, and I'm not assigning anything unusual to that.

FYI, I uninstalled the app from the tablet first, and did a new install of the app in debug mode... it never opened but just immediately stopped...

It looks like it's B4A and not my data file it's trying to access...

Also, before I deleted the app from the tablet, I checked the data usage and there was none on the SD card at all for the app... I can't tell on the Moto-X because there's no SD card ability.

More info:

LogCat connected to: B4A-Bridge: unknown SoftwinerEvb-
--------- beginning of /dev/log/main
--------- beginning of /dev/log/system
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (service1) Create **
** Service (service1) Start **
Connected to B4A-Bridge (Wifi)
** Activity (main) Pause, UserClosed = true **
Installing file.
PackageAdded: package:com.twodogapps.gaa
Copying updated assets files (47)
java.lang.RuntimeException: java.io.FileNotFoundException: /mnt/sdcard/Android/data/com.twodogapps.gaa/files/virtual_assets/about.bal: open failed: ENOENT (No such file or directory)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:159)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:91)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:76)
at com.twodogapps.gaa.main.afterFirstLayout(main.java:90)
at com.twodogapps.gaa.main.access$100(main.java:16)
at com.twodogapps.gaa.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.FileNotFoundException: /mnt/sdcard/Android/data/com.twodogapps.gaa/files/virtual_assets/about.bal: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:416)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at anywheresoftware.b4a.objects.streams.File.OpenOutput(File.java:370)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:146)
... 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:400)
... 17 more
 
Last edited:
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
4.1 on the tablet, kitkat on the phone, and the emulators are various versions...
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Actually Android version isn't the issue here.

What is the code that is failing? Of course DirInternal isn't actually an Internal Directory as such, so could be placed on the SD card.
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
I fails immediately... no code... it's trying to find the layout files.

No, haven't changed ANY names. About.bal is a simple form that I created in the initial stages of this app 2+ months ago.
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
Nope...
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
3.50
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
No... the app runs perfectly on the phone and emulators... dies on the tablet... something obviously to do with how the files are copied during installation.

Yes, they're all there in the IDE...
 
Upvote 0

eps

Expert
Licensed User
Longtime User
So no name changes or anything along those lines..? Maybe the phone has an old version of a file on there or something.. Is the set to use External Memory? or something...? I think I had an issue once with an App which got confused, it was installed to use Internal Memory only (standard) then changed to use External Memory and then it threw a wobbler as it still found some of the older files and complained.

If you attempt to open the BAL file within B4A what happens?
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
I'm going to try that now Margaret. All of mine are in upper and lower case. I'll rename about and see if it skips that and goes on to the next...
 
Upvote 0
Top