Compiler won't access the new .bal name by default.

chuck3e

Active Member
Licensed User
Longtime User
I decided to use a different name referenced by the Designer so I:

Did a "Save As" to the new file name within the Designer and changed the Activity.LoadLayout( ) to reference the new name.

However, when I re-compile the program, it keeps asking for the old name.

How do I get it to switch to the new name?

-Chuck
 

chuck3e

Active Member
Licensed User
Longtime User
I developed a program called cejOpening to test this problem out. I compiled it, tested it, and everything worked just fine, as expected. The file name was cejOpening.b4a, the Designer Activity name was cejOpening, and I had coded Activity.LoadLayout("cejOpening").

Then I changed all the names:

In Designer I saved the cejOpening Activity as BalTest,

In Project Attributes I changed #ApplicationLabel: to BalTest,

I changed the code to Activity.LoadLayout("BalTest"),

I renamed the cejOpening.b4a file to BalTest.b4a,

I deleted cejOpening.bal since baltest.bal is what I want to use.

Within the compiler, as soon as I go to "File" and "Open Source" to open BalTest.b4a, I get a popup box with the following message:

An error occurred.
Error accessing the following files:
C:\Android\BalTest\Files\cejOpening.bal: Unable to find the specified file.

When I click on the popup's OK button, the source code opens up.

I then go to Designer/File/Open and open baltest.bal.

Then when I click on the little blue "Run" arrow to comple and test the program I get the following message:

Parsing code. 0.02
Compiling code. Error
Could not find file 'C:\Android\BalTest\Files\cejopening.bal'.

The program won't compile now. So somewhere the compiler thinks the .bal file should still be named cejOpening. Where is that name located and is it changeable?

-Chuck
 
Upvote 0

chuck3e

Active Member
Licensed User
Longtime User
Erel,
If you mean in the Designer, the answer is yes, the old name still shows up there in the list when I click on File.

I noticed there is a way to clean the Files Folder in the Tools tab of the compiler. I suppose that should have been used after I created the new view, eh?

When I try that now it error out because it can't find the file. In anticipation of your next reply, I guess I can create a dummy one and run that cleaner again to see if it clears that out.
-Chuck
 
Last edited:
Upvote 0

chuck3e

Active Member
Licensed User
Longtime User
Nope, it didn't show up when I ran the File cleaner. It still thinks it's being used by something.
 
Upvote 0

chuck3e

Active Member
Licensed User
Longtime User
OK, I finally figured out what you two are talking about. I have been looking for Files in all the wrong places. After much searching I finally found a tab labeled Files at the far bottom right of the IDE. I used it and it solved my problem.

Thank you very much for your help. Most of the time I feel like I'm alone groping in the dark.

I do want to quickly add that, once understood, B4a is so easy to use to quickly develop an application and to develop in real time with the actual device. The emulator works great too.
 
Upvote 0

rayzrocket

Member
Licensed User
Longtime User
Twice this issue that chuck3e encountered has hung me up...the second time, I simply forgot what I had to do...until i found this post to remind me about the screen bar to the right of the IDE is tabbed with the local where to add&remove 'files'.
 
Upvote 0
Top