Android Question Advertising ID, can't compile

marcick

Well-Known Member
Licensed User
I want to implement the advertising ID but following the instructions "add a reference to FirebaseAdMob" (I check that library) then I'm not able to compile.
I have already increased the process timeout to 300 sec and MaxRamForDex to 2048 without success.

If I uncheck the FirebaseAdMob library everything seems to work fine
Where I'm wrong ?

B4X:
B4A Version: 9.00
Parsing code.    (0.55s)
Building folders structure.    (0.44s)
Compiling code.    (3.58s)
Compiling layouts code.    (1.03s)
Organizing libraries.    (0.39s)
Generating R file.    (17.10s)
Compiling debugger engine code.    (19.68s)
Compiling generated Java code.    (34.20s)
Convert byte code - optimized dex.    Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:68)
    at java.lang.StringBuilder.<init>(StringBuilder.java:89)
    at com.android.dx.rop.type.Prototype.withFirstParameter(Prototype.java:399)
    at com.android.dx.rop.type.Prototype.intern(Prototype.java:208)
    at com.android.dx.cf.iface.StdMethod.<init>(StdMethod.java:46)
    at com.android.dx.cf.direct.MethodListParser.set(MethodListParser.java:81)
    at com.android.dx.cf.direct.MemberListParser.parse(MemberListParser.java:217)
    at com.android.dx.cf.direct.MemberListParser.parseIfNecessary(MemberListParser.java:108)
    at com.android.dx.cf.direct.MethodListParser.getList(MethodListParser.java:54)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:565)
    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:855)
    at com.android.dx.command.dexer.Main.access$7(Main.java:850)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1826)
    at com.android.dx.command.dexer.Main.processClass(Main.java:838)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:806)
    at com.android.dx.command.dexer.Main.access$3(Main.java:777)
    at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1779)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:760)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:646)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
    at com.android.dx.command.dexer.Main.runDx(Main.java:293)
    at com.android.dx.command.dexer.Main.main(Main.java:249)
    at com.android.dx.command.Main.main(Main.java:94)
 

Erel

Administrator
Staff member
Licensed User
How much RAM is installed? What happens if you increase MaxRamForDex?
 

marcick

Well-Known Member
Licensed User
I have 8G Ram.
Actually the proces stimeout is 360 sec and MaxRamForDex 4096.
If I uncheck the FirebaseAdMob library I can get the AdvertisingID without errors.

B4X:
B4A Version: 9.00
Parsing code.    (0.52s)
Building folders structure.    (0.18s)
Compiling code.    (1.45s)
   
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.28s)
Organizing libraries.    (0.00s)
Generating R file.    (0.00s)
Compiling generated Java code.    (10.67s)
Convert byte code - optimized dex.    Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.util.regex.Pattern$BnM.optimize(Pattern.java:5408)
    at java.util.regex.Pattern.compile(Pattern.java:1709)
    at java.util.regex.Pattern.<init>(Pattern.java:1351)
    at java.util.regex.Pattern.compile(Pattern.java:1054)
    at java.lang.String.replace(String.java:2227)
    at com.android.dx.cf.direct.ClassPathOpener.compareClassNames(ClassPathOpener.java:198)
    at com.android.dx.cf.direct.ClassPathOpener.access$000(ClassPathOpener.java:37)
    at com.android.dx.cf.direct.ClassPathOpener$3.compare(ClassPathOpener.java:252)
    at com.android.dx.cf.direct.ClassPathOpener$3.compare(ClassPathOpener.java:250)
    at java.util.TimSort.binarySort(TimSort.java:292)
    at java.util.TimSort.sort(TimSort.java:235)
    at java.util.Arrays.sort(Arrays.java:1512)
    at java.util.ArrayList.sort(ArrayList.java:1454)
    at java.util.Collections.sort(Collections.java:175)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:250)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:760)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:646)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
    at com.android.dx.command.dexer.Main.runDx(Main.java:293)
    at com.android.dx.command.dexer.Main.main(Main.java:249)
    at com.android.dx.command.Main.main(Main.java:94)
 

Erel

Administrator
Staff member
Licensed User
Are you sure that you changed it while the IDE is closed?
If I uncheck the FirebaseAdMob library I can get the AdvertisingID without errors.
This means that there is another library that added the required references. If it works for you then it is fine.
 
Top