Android Question Error loading file in the designer [appears solved...]

Didier9

Well-Known Member
Licensed User
Longtime User
Just upgraded B4A in my backup computer. I had not used that computer in probably a year. I first had an issue which I traced to a forum post recommending to upgrade the tools so I did that.
Now the app crashes when I open a particular activity, on the Activity.LoadLayout() statement. When I try to open the layout in the designer, I get the error message attached.
I also attached the layout file.
The app compiles, loads and runs fine when I use the other laptop.
The two machines are otherwise almost identical.
Any help appreciated!
 

Attachments

  • b4a.png
    7.8 KB · Views: 121
  • selectbluetooth.bal
    7.6 KB · Views: 100

drgottjr

Expert
Licensed User
Longtime User
file appears to contain nothing but nulls...
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
I am not sure what happened, I may have copied the file before it was fully restored from the backup. That's not the cause of the problem, even though it would have definitely been a problem on its own... This is the "proper" file. It works in the "main" laptop but not in the "backup" laptop.
It crashes the app when I try to open this activity with this error and crashes the designer when I try to open the layout file with the error message in the original post.
 

Attachments

  • selectbluetooth.bal
    7.6 KB · Views: 94
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
the file is still 7.6kb of nulls. the error message seems to imply there is a problem with the layout. if you're looking for the mentioned null object reference, you've got 7.6kb of them in that file. if the file you're posting is a valid layout file, i do apologize, but i've never had a problem downloading a file from here.
 

Attachments

  • dump.png
    21.9 KB · Views: 102
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
This is mind blowing...
That's the second time. I looked at the file before attaching it to this post and it was not blank. Now it's blank.
The two laptops share files via Sync.
I do not normally run the software from the shared drive (it causes issues with a bunch of apps) so each laptop has a local folder where I run the software from, then for backup, I copy the working folder to the Sync folder. When I want to run the same software on the other laptop, I copy from the Sync folder back to the other laptop's local drive.
This has worked for many many years. I do this with my C source code and B4J, and I was doing it with Visual Basic before that. I used Dropbox before Sync.
Well, I am working (and sending this message) from the "main" laptop now and this is the file...

This all started because I got a newer new laptop last Friday (so there are 3 at the moment, the main, the backup and the new), so I started the process of copying and installing everything on that new laptop and I thought I would check the old backup machine to make sure the process worked as I expected. That's when the problem started.
The good news is that the new laptop seems to be behaving normally, no issue with that file or with running the app once loaded on the phone (but a strange issue that I cannot load the app via USB on the new laptop, only with B4A Bridge. It's the same phone, same version of B4A and same Windows 10... But that's another issue.)

Anyhow, there seems to be a weird problem with Sync on the backup machine, so I am going to take it offline until I figure it out.

Sorry for the distraction. I'll update when I have something.
 

Attachments

  • selectbluetooth.bal
    7.6 KB · Views: 95
Last edited:
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
So I downloaded the file from the forum back on the backup machine, renamed the previous (blank) one with the name selectbluetooth2.bal and opened the old and new in WinMerge and got this:


I have to go to work now but I will try again tonight. I have no idea why that particular file seems to change after it's copied from the Sync folder...
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
I think I found the problem.

When copying files to the Sync folder, it would initially create the directory structure with empty files (0 length), then populate the files according to some algorithm. So before copying files back to another place, I just had to wait until Explorer reported a size >0. Convenient.

Apparently they must have changed something because that's not the way it works now. It seems to create an empty file of the proper size but containing only nulls, then later on the file is actually filled with data.

So the problem was that I was copying the file from the Sync folder to the local folder before it was actually transferred. And since it was the right size but not working, I would copy it again from the source computer, so it never had a chance to actually update.

It may have been compounded by a slow network. My internet connection is usually good enough (I have a business account with a fixed IP and 250Mb/s, or at least that's what I pay for...) that when copying a relatively small amount of data like this app from one computer to another, by the time I get off my chair and to the other machine, everything was transferred. That was obviously not the case yesterday or this morning.

After a day at work, all is working now.

Sorry for the bandwidth...
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
pre-populating the file with nuls was a nice touch. remember "sneakernet"? worked then, still works now.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…