Android Question B4X_cba problem

Theera

Well-Known Member
Licensed User
Longtime User
Refer to this After I've tested tchart's B4X_cba ,I've error code while compiling. How do I solve it?
My code is belows
B4X:
#Region  Addition CustomBuildActions
'Credits to: tchart's codes
'คุณสาารถเลือกปรับแต่ง CustomBuildActions เหล่านี้ได้อย่างเหมาะสม โดยการทำการ Unremark /Remark

'ประมวลผลเท่านั้น ( Compile Only)
'#CustomBuildAction: 2, %WINDIR%\System32\b4x_cba.exe, -action compileonly

'สำเนา Jar File to C:\Temp folder(CopyJar )
'#CustomBuildAction: 2, %WINDIR%\System32\b4x_cba.exe, -action copyjar -directory C:\TempTemp

'บันทึกวันเวลาที่ถูกสร้างขึ้นไว้ในไฟล์ Build.txt
'#CustomBuildAction: folders ready, %WINDIR%\System32\b4x_cba.exe, -action buildtime 
'หรือ
'#CustomBuildAction: folders ready, %WINDIR%\System32\b4x_cba.exe, -action buildtime -dateformat dd/MM/yyyy -timeformat HH:mm:'

'ปรับปรุงเป็นเวอร์ชันล่าสุด
#CustomBuildAction: folders ready, %WINDIR%\System32\b4x_cba.exe, -action updateversion

#End Region
 

DonManfred

Expert
Licensed User
Longtime User


Did you sync the files folder after 1. run? note that you probably should run buildtime once before you use updateversion. And do not forget sync.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
Did you sync the files folder after 1. run? note that you probably should run buildtime once before you use updateversion. And do not forget sync.
I will do it tomorrow.My computer is at myoffice. Thank you for kind of you, DonManfred
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
@Theera

With "updateversion" it will attempt to parse an existing file if version.txt already exists. This can cause problems if the format is not X.X.X or the file is empty.

I believe the error is caused by an empty version.txt file. I have added logic to deal with this - new version is on https://github.com/ope-nz/b4x_cba



Also I see you are using "%WINDIR%\System32\b4x_cba.exe" for the path. It is tidier if you copy b4x_cba.exe to the install path of B4J etc. That way you can just omit the path

B4X:
#CustomBuildAction: folders ready, b4x_cba.exe, -action updateversion



Note, the sync is only required to get rid of the warning #17 in B4X. This doesnt affect the operation of the tool.

 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
Also I see you are using "%WINDIR%\System32\b4x_cba.exe" for the path. It is tidier if you copy b4x_cba.exe to the install path of B4J etc. That way you can just omit the path
Hi tchart,
Your b4x_cba.exe is exe file for crossplatform,so I copied it as the same folder as Erel's folder as my b4xtemplate file. My code is incorrect,isn't it?
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
Hi again,
After using the new b4x_cba.exe,I found the another error code.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Hi again,
After using the new b4x_cba.exe,I found the another error code.
Hi Theera.

That error is expected. It is the way Erel suggested to stop the ide from running the project - the way it’s done it to return a deliberate error. That’s why it is done last. Less of an issue for b4a and b4i.

Your path is fine if you are using it for all platforms.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
B4X:
'Ctrl + click to increment version: ide://run?File=b4x_cba.exe&Args=-action&Args=updateversion

Your code has the problem, you have to change as belows
B4X:
'Ctrl + click to increment version: ide://run?file=b4x_cba.exe&args=-action&Args=updateversion
It will be worked, but I have some problemabout coding in another thread. Please helpme.

Thread 'How to code the command link' https://www.b4x.com/android/forum/threads/how-to-code-the-command-link.164685/
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
Not clear on what the problem is. Did you just make some of the command lower case?
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
Not clear on what the problem is. Did you just make some of the command lower case?
You have to try to do. I compared with Erel'scode for solved.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…