Android Question code too large error on Release Obfuscation

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all

I have a problem. When I compile my code in Release it compiles and works fine.
But when I compile the same code with Release Obfuscation I have this error

B4X:
B4A Version: 12.20
Parsing code.    (0.55s)
    Java Version: 8
Building folders structure.    (0.07s)
Compiling code.    (0.44s)
 
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.04s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.28s)
Linking resources    (0.44s)
Compiling generated Java code.    Error
B4A line: 647
End Sub
javac 1.8.0_40
src\alex\HCMS\EVV\moddb.java:191: error: code too large
public static String  _process_globals() throws Exception{
                      ^

I did the search and read that it's because module or procedure is too big.

In my case the whole moddb has only 670 lines including comments. Is it too big?

I also have another module modFun with almost 8000 lines.

modDB is a module with tables structures - it checks if the table exists in the database and if not - creates it on fly.

All these tables structure variables are in modDB Process_Globals and also it has 1 private function and 1 public sub.

I didn't use obfustation for a while but I remeber it was Ok,


UPDATE: If I reduce the number of lines in modDB Process_Globals to 513 - it works.
 
Last edited:

MicroDrie

Well-Known Member
Licensed User
Longtime User
UPDATE: If I reduce the number of lines in modDB Process_Globals to 513 - it works.
The Android Tutorial Code Obfuscation provides some background information. The file named ObfuscatorMap.txt will be created under the Objects folder. Perhaps the difference of that file in the working and non-working file gives insight into what is going wrong.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Hi all

I have a problem. When I compile my code in Release it compiles and works fine.
But when I compile the same code with Release Obfuscation I have this error

B4X:
B4A Version: 12.20
Parsing code.    (0.55s)
    Java Version: 8
Building folders structure.    (0.07s)
Compiling code.    (0.44s)
 
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.04s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.28s)
Linking resources    (0.44s)
Compiling generated Java code.    Error
B4A line: 647
End Sub
javac 1.8.0_40
src\alex\HCMS\EVV\moddb.java:191: error: code too large
public static String  _process_globals() throws Exception{
                      ^

I did the search and read that it's because module or procedure is too big.

In my case the whole moddb has only 670 lines including comments. Is it too big?

I also have another module modFun with almost 8000 lines.

modDB is a module with tables structures - it checks if the table exists in the database and if not - creates it on fly.

All these tables structure variables are in modDB Process_Globals and also it has 1 private function and 1 public sub.

I didn't use obfustation for a while but I remeber it was Ok,


UPDATE: If I reduce the number of lines in modDB Process_Globals to 513 - it works.

Try to change the modDB code module as class module.
 
Upvote 0
Top