Android Question [SOLVED] Problems with B4A

hatzisn

Expert
Licensed User
Longtime User
Today out of the blue I started having problems compiling with B4A.

Firstly it asked me to install androidx.work:work-runtime.
I did install it from SDK manager and now it asks me to install the com.google.guava:listenablefeature which is not apparent in the SDK Manager list even with search.
What am I supposed to do? Did I missed something?
 

DonManfred

Expert
Licensed User
Longtime User
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Hi DonManfred,

I added the suggested library and now I get this error:

B4A Version: 10.2
Java Version: 11
Parsing code. (0.32s)
Building folders structure. (0.28s)
Compiling code. (1.00s)
Compiling layouts code. (0.14s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling debugger engine code. (0.08s)
Compiling generated Java code. (0.68s)
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
maybe this help:
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
More detailed error which before was not apparent but the second time I have ran it it appeared:

B4A Version: 10.2
Java Version: 11
Parsing code. (0.32s)
Building folders structure. (0.22s)
Compiling code. (0.86s)
Compiling layouts code. (0.08s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling debugger engine code. (0.07s)
Compiling generated Java code. (0.10s)
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
at com.android.dx.util.ByteArray.slice(ByteArray.java:98)
at com.android.dx.cf.cst.ConstantPoolParser.parseUtf8(ConstantPoolParser.java:417)
at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:271)
at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:334)
at com.android.dx.cf.cst.ConstantPoolParser.parse0(ConstantPoolParser.java:310)
at com.android.dx.cf.cst.ConstantPoolParser.parse(ConstantPoolParser.java:153)
at com.android.dx.cf.cst.ConstantPoolParser.parseIfNecessary(ConstantPoolParser.java:127)
at com.android.dx.cf.cst.ConstantPoolParser.getPool(ConstantPoolParser.java:118)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:505)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:420)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:402)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:253)
at com.android.dx.command.dexer.Main.parseClass(Main.java:851)
at com.android.dx.command.dexer.Main.access$7(Main.java:846)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1822)
at com.android.dx.command.dexer.Main.processClass(Main.java:834)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:802)
at com.android.dx.command.dexer.Main.access$3(Main.java:773)
at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1775)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:170)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:756)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:650)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
The error seems to occur only in Debug Mode. Perfect. I cannot work.

It is as if I have the curse of the American Indian: Where ever you go may there be a cloud above you and rain.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
It gets better and better. Having set MaxRamForDex=4096 I get the following error.

Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL ERROR:
Exception in thread "pool-1-thread-1" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
It seems to have been solved with:

1) Complete uninstall of B4A
2) Deletion of Java jdk folder
3) Deletion of Android folder
4) Downloading again the Java JDK from B4A's page
5) Downloading from Google the latest tools (you can see it after clicking on the link "SDK license" in B4A page).
6) Renaming the folder cmdln-tools to tools
7) Downloading the required resources from B4A's page
8) Reinstalling B4A

I have not tried to use the SDK manager to update and I am afraid to do so. But I will do it when I will have finished my job.
 
Last edited:
Upvote 0
Top