Android Question corrupt layout?

Lee Gillie CCP

Active Member
Licensed User
Longtime User
In all the years of working with B4A, this is the strangest thing I have ever seen...

Yesterday I built and pushed an APK, and all was fine. I checked the project in using VSS (MS Visual Source Safe). But one more tiny bug to fix...

Today I check it all back out, and before any changes dId a debug compile and run to my tablet AVD.

The main screen has a number of buttons to take you to other activities. But when I click button A, it actually highlights button C, and goes to the button C click handler. In fact the handlers for all buttons is either scrambled to run the wrong event handler, or does nothing at all.. This seems to have affected all layouts created in the designer, and loaded with LoadLayout. Manually created items, wired via initialize all work fine. It behaves the same way if I run a non-debug build.

What I have tried...
  • Cleaned the project
  • Verify names in the designer, they are all correct.
  • Replaced the Main.bal file from a backup copy I made yesterday before the final release build
  • Regenerated all of the views and the handlers I am using
  • I tried to peruse through the generated java, but I am not an expert, and did not notice anything obvious
I first suspected the culprit was VSS. In VSS you must declare file extensions which are binary in nature, and need to not have any encoding, such as exe, dll, pdf et. al. But if it was VSS, then why has it never happened before? VSS tries to auto-detect binary files, but it is not always accurate, especially for files like pdf which have internal structure pointers. Also, then, why did not restoring from a known good bal file from yesterday fix it? It seemed to have no effect at all. And why suddenly for it to trash every layout, when there have been zero issues for the past 10 years of working in this way.

Has anybody ever seen anything like this? I am going to create a new project from scratch and see if it happens there. I am hoping someone knows a trick.
 

Lee Gillie CCP

Active Member
Licensed User
Longtime User
Vss is discontinued software

Use Google Crashlytics

Yes I am well aware. Not even trying to debate that fact, but there is too much (unrelated to my real issue) to hash over about why we still use VSS. Also... I believe I have vindicated VSS on this regard. Your response was oblivious to my actual question anyway.

On further research I believe my bal is NOT corrupt.

I noticed that buttons were also responding to clicks that were no where near any buttons. So it is not mapping the wrong layout button to the event handlers. Android just doesn't know where the mouse really is.

I use the emulators from Android Studio because I have found the VDM and SDK Manager in B4A to be problematic... at the time the quickest solution was to use tools from Android Studio. I recall the other day I did a suggested update to AS, and I believe SDK components such as the emulator update were updated as well. I will double check the SDK, but I think ultimately I will redirect a USB port at home to my workstation at the office via Windows RDP. This will allow me to test with a real tablet.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Have you by any chance reused view names across layouts?
 
Upvote 0
Top