Android Question build b4a app using github ci ?

AbdurRahman

Member
How to build b4a app using github VPS yaml script ?
Thanks erel for making b4a cli version.

What I tried ?
I'm at stage of just finishing.
I made IDE portable and compressed via 7zip.
With batch script, I download, extract and compile apk using it.

B4X:
git clone https://github.com/graysuit/b4a_compiler.git
xcopy b4a_compiler "" /h /i /c /k /e /r /y
mkdir b4a
7z.exe x "b4a_compiler/b4a.7z" -ob4a -y
"b4a/b4a/B4ABuilder.exe" -Task=Release -NoSign=False -Obfuscate=False -ShowWarnings=True -Optimize=True -NoClean=True -Output=anti_vm.apk

What's problem ?
B4X:
D:\a\anti-vm\anti-vm\android>"b4a/b4a/B4ABuilder.exe" -Task=Release -NoSign=False -Obfuscate=False -ShowWarnings=True -Optimize=True -NoClean=True -Output=anti_vm.apk
B4ABuilder v10.70
System.Exception: ini file not found. Please run B4A first.
   at ie.n()
   at ie.j(String[] A_0)
   at ie.m(String[] A_0)
ini file not found. Please run B4A first.
Error: Process completed with exit code 1.

Looks like some ini file missing. It seems like ini file saved in appdata is necessary.
But while opening that, its clearly states that it is specific user based.

Now how do I specify it to use github environment auto-detect java.exe, sdk etc ?
Please see
actions: https://github.com/Back-X/anti-vm/runs/2265424912
compile.bat PULL REQUEST will be also appreciated.

There's also 1 more law issue. I'm not sure whether its legal to make b4a portable and distribute for compiling purpose ?
 

Attachments

  • github_ci_logs.zip
    9.6 KB · Views: 35

Erel

Administrator
Staff member
Licensed User
Upvote 0

AbdurRahman

Member
Its almost completed except last error.

I have configured ini and append default system javabin and sdk path for ini and copy it to %appdata%\Anywhere Software\Basic4android.
Its fine. I tested this.
Bash:
echo JavaBin=%JAVA_HOME%\bin >> b4xV5.ini
echo PlatformFolder=%ANDROID_SDK_ROOT%\platforms\android-30 >> b4xV5.ini
echo ToolsFolder=%ANDROID_SDK_ROOT%\tools  >> b4xV5.ini
xcopy "%CD%\b4xV5.ini" "%appdata%\Anywhere Software\Basic4android\*" /C /Y



So what problem now causing it is KeyNotFoundException. It fails at BuildConfiguration: Default,b4a.example.
Rich (BB code):
D:\a\anti-vm\anti-vm\android>"b4a/b4a/B4ABuilder.exe" -Task=Release -ShowWarnings=True
B4ABuilder v10.70
BaseFolder: D:\a\anti-vm\anti-vm\android
ProjectFile: D:\a\anti-vm\anti-vm\android\anti-vm.b4a
BuildConfiguration: Default,b4a.example
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at ie.l()
   at ie.j(String[] A_0)
   at ie.m(String[] A_0)
The given key was not present in the dictionary.

Full logs at: https://github.com/Back-X/anti-vm/runs/2272322328?check_suite_focus=true
 
Upvote 0

AbdurRahman

Member
Still no luck. Same result. 😌
B4X:
D:\a\anti-vm\anti-vm\android>"b4a/b4a/B4ABuilder.exe" -Task=build -ShowWarnings=True
B4ABuilder v10.70
BaseFolder: D:\a\anti-vm\anti-vm\android
ProjectFile: D:\a\anti-vm\anti-vm\android\anti-vm.b4a
BuildConfiguration: Default,b4a.example
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at ie.l()
   at ie.j(String[] A_0)
   at ie.m(String[] A_0)
The given key was not present in the dictionary.


Add -Task=build to build the project in the current folder:
I set same -Task=build.
Thanks a lot sir. I have done all this with your help.
 
Upvote 0

AbdurRahman

Member
It run fines locally.

B4X:
C:\Users\gray\Desktop\b4a\anti-vm>dir
 Volume in drive C has no label.
 Volume Serial Number is 7A32-68C9

 Directory of C:\Users\gray\Desktop\b4a\anti-vm

04/06/2021  06:31 PM    <DIR>          .
04/06/2021  06:31 PM    <DIR>          ..
04/06/2021  09:22 AM             1,963 anti-vm.b4a
               1 File(s)          1,963 bytes
               2 Dir(s)  44,038,397,952 bytes free

C:\Users\gray\Desktop\b4a\anti-vm>"C:\Program Files\Anywhere Software\Basic4android\B4ABuilder.exe" -Task=build
B4ABuilder v10.70
Global Java version: 8
BaseFolder: C:\Users\gray\Desktop\b4a\anti-vm
ProjectFile: C:\Users\gray\Desktop\b4a\anti-vm\anti-vm.b4a
BuildConfiguration: Default,b4a.example
Parsing code.
Java Version: 8
Compiling code.
Compiling layouts code.
Organizing libraries.
(AndroidX SDK)
Compiling resources
Linking resources
link  --auto-add-overlay --no-version-vectors --manifest AndroidManifest.xml -I "C:\b4a_compiler\sdk\platforms\android-30\android.jar" bin\extra\compiled_resources\b4a.example.zip -A bin\extra\assets  -A ..\Files -A b4xlibs\Files  -o bin\temp.ap_ --java gen
Compiling generated Java code.
Convert byte code - dex.
Copying libraries resources
Output file: C:\Users\gray\Desktop\b4a\anti-vm\Objects\bin\temp.ap_
ZipAlign file.
Signing package file (debug key).
Completed successfully: 20.58 seconds

C:\Users\gray\Desktop\b4a\anti-vm>

I think problem may in git VPS.
 
Upvote 0

AbdurRahman

Member
This time I used same my own jdk,
with sdk that b4a share link at download page,
but same result.

How do I know what's causing problem ?
Looks like IDE is obfuscated from error msg.

Is there any logging system for cli version as well ?
I tried -log, but failed.

 
Upvote 0

Blueforcer

Well-Known Member
Licensed User
This time I used same my own jdk,
with sdk that b4a share link at download page,
but same result.

How do I know what's causing problem ?
Looks like IDE is obfuscated from error msg.

Is there any logging system for cli version as well ?
I tried -log, but failed.

Do you had any successful progress in this topic?
 
Upvote 0
Top