Android Question error occured when trying releasing my app in Obfuscator Mode

M.LAZ

Active Member
Licensed User
Longtime User
Hi B4X Guys,
this happen only in Obfuscator Mode , please any help to solve this error , i'm using BitmapCreator Class.


Error Message:
B4A Version: 12.80
Parsing code.    (0.81s)
    Java Version: 14
Building folders structure.    (0.58s)
Running custom action.    (0.11s)
Compiling code.    (0.61s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.06s)
Organizing libraries.    (0.08s)
    (AndroidX SDK)
Compiling resources    (10.93s)
Linking resources    (4.72s)
Compiling generated Java code.    Error
src\com\xxxxx\driver\bitmapcreator.java:5096: error: cannot find symbol
                    target._drawbitmapcreatortransformed(dt);
                          ^
  symbol:   method _drawbitmapcreatortransformed(_drawtask)
  location: variable target of type bitmapcreator
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
only showing the first 1 errors, of 5 total; use -Xmaxerrs if you would like to see more

javac 14.0.1
 

Attachments

  • BitmapCreator.bas
    107.7 KB · Views: 14

agraham

Expert
Licensed User
Longtime User
Probably because the Java code in DrawBitmapCreatorsAsync is calling

target._drawbitmapcreatortransformed(dt);

Which doesn't exist when obfuscated as Sub DrawBitmapCreatorTransformed has been obfuscated. You need to add an underscore to the Sub name to stop it being obfuscated

Public Sub DrawBitmapCreator_Transformed (Task As DrawTask)

and amend the Java to call it as

target._drawbitmapcreator_transformed(dt);
 
Upvote 1

M.LAZ

Active Member
Licensed User
Longtime User
Hi @agraham
when i edited many errors appeared as you said,


B4X:
B4A Version: 12.80
Parsing code.    (0.82s)
    Java Version: 14
Building folders structure.    (0.06s)
Running custom action.    (0.14s)
Compiling code.    (0.76s)
   
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.03s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.61s)
Linking resources    (4.65s)
Compiling generated Java code.    Error
src\com\xxxx\xxx\bitmapcreator.java:5107: error: cannot find symbol
                        targetModule.getBA().raiseEvent2(null, false, eventName + "_bitmapready", false, _getbitmap());
                                                                                                         ^
  symbol: method _getbitmap()
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error

javac 14.0.1


but in this error, getbitmap related to sub which called in other classes many times
i changed getbitmap in the main sub to get_bitmap and a lot of errors appears.
 
Last edited:
Upvote 0

M.LAZ

Active Member
Licensed User
Longtime User
Use BitmapCreator library instead of the code.
yes i tried that before BitmapCreator , BitmapsAsync
many errors as you see in picture
 

Attachments

  • WhatsApp Image 2024-12-16 at 23.48.06_2440c2b7.jpg
    145.7 KB · Views: 18
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…