Convert byte code - optimized dex. Error - Need Help Pls :(

Joel Fonseca

Member
Licensed User
Longtime User
Hello,

My application was going OK, then I had more Modules, more Layouts, when I finished adding what I wanted, I tried to compile and this error starts to appear and I can't compile this any more, anyone can help me out pls ?, thanks in advance.

B4X:
Compiling code.                         3.84
Generating R file.                      0.00
Compiling generated Java code.          26.37
Convert byte code - optimized dex.      Error
UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
   at com.android.dx.util.Bits.makeBitSet(Bits.java:38)
   at com.android.dx.util.BitIntSet.<init>(BitIntSet.java:35)
   at com.android.dx.ssa.SetFactory.makeDomFrontSet(SetFactory.java:66)
   at com.android.dx.ssa.DomFront.run(DomFront.java:107)
   at com.android.dx.ssa.SsaConverter.placePhiFunctions(SsaConverter.java:298)
   at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:52)
   at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:99)
   at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:73)
   at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:269)
   at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:131)
   at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:85)
   at com.android.dx.command.dexer.Main.processClass(Main.java:369)
   at com.android.dx.command.dexer.Main.processFileBytes(Main.java:346)
   at com.android.dx.command.dexer.Main.access$400(Main.java:59)
   at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:294)
   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:134)
   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)
   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)
   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)
   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)
   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
   at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:190)
   at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:122)
   at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
   at com.android.dx.command.dexer.Main.processOne(Main.java:313)
   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:233)
   at com.android.dx.command.dexer.Main.run(Main.java:185)
   at com.android.dx.command.dexer.Main.main(Main.java:166)
   at com.android.dx.command.Main.main(Main.java:90)
   Standard dexer.

My appz has:

- 272 Module Files
- 1.021 items including pictures + layout files on the "Files" directory
- The entire project folder has 57 MB of files

Is there any limitation in the project structure before starting to give this error?

I have 4GB of ram, available now it's: 1819MB

Help needed to keep me on this project pls.

Thanks in advance,

Joel
 

Joel Fonseca

Member
Licensed User
Longtime User
And now it's giving me this error:

B4X:
Compiling code.                         2.72
Generating R file.                      0.00
Compiling generated Java code.          13.48
Convert byte code - optimized dex.      Error
trouble writing output: opcode == null
   Standard dexer.


When this error appeared I was monitoring my memory in the task manager ,and I still had 800 MB free of ram and the error appeared, I have 1.8 GB free of Disk space on my C:\ where my project is, have 5 GB free on my swap file disk.

I'm without ideas how to solve this problem :(, it's because of the amount of Module files I have ?, how can I stick all those modules in just one module file ? without messing up my appz ?, need a lot of help, thanks in advance.

Joel
 
Upvote 0

Joel Fonseca

Member
Licensed User
Longtime User
Well I guess I figure it out what the problem is...

One Module has a layout that has more than 50 Labels on it...

I am reconstructing the application from the beginning putting module a module + files, and with only 2 of those (modules + layout with 50 labels), the application hanged lol, imagine with 90 labels that had this configuration :(

I have to redone this appz in a different way, more light :)

We are always learning :)

Thanks :)
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can increase the memory size that the dexer process is allowed to use.
Open the ini file that is located in:
C:\Users\<Your user name>\AppData\Roaming\Anywhere Software\Basic4android
Change this line:
MaxRamForDex=1024
To:
MaxRamForDex=3000

Note that you must do this change when B4A is closed. Otherwise it will override the change when it gets closed (and it reads it only when it opens).

You can also disable the debugger (Project - Attach debugger).
 
Last edited:
Upvote 0

Joel Fonseca

Member
Licensed User
Longtime User
Erel, i got a problem again :(

B4X:
Compiling code.                         2.80
Generating R file.                      0.00
Compiling generated Java code.          12.48
Convert byte code - optimized dex.      Error
trouble writing output: opcode == null
   Standard dexer.

It's giving me this error when i try to compile, i had some modules and put some image files and simple layouts on the file folder, left the other heavy layouts outside the project, but this error appears now, what can i do ?

I have this on my b4aV0.1 file

B4X:
MaxRamForDex=1536
OptimizedDexerPort=36729
DesignerDesktopPort=36728
DesignerDevicePort=5000
ProcessesTimeoutSeconds=1000

Need help :(
 
Upvote 0

Joel Fonseca

Member
Licensed User
Longtime User
This is very weird, I was testing each line of the code with compiling each line to see if I was able to compile without errors, until it gives me that error:

I have this in one of my activity's:

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   Dim MediaPlayer1 As MediaPlayer

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim ListView1 As ListView
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("lisboa")
   ListView1.Initialize("ListView1")
   Dim GD As GradientDrawable
   GD.Initialize("TR_BL", Array As Int(Colors.Gray, Colors.LightGray))
   Activity.Background = GD
   ListView1.ScrollingBackgroundColor = Colors.Transparent
   
   Dim aline_Bitmap As Bitmap
   Dim ana_mendes_Bitmap As Bitmap
   Dim beatriz_Bitmap As Bitmap
   Dim bela_melo_Bitmap As Bitmap
   Dim bianca_Bitmap As Bitmap
   Dim brenna_Bitmap As Bitmap
   Dim bruna_Bitmap As Bitmap
   Dim carina_almeida_Bitmap As Bitmap
   Dim catarina_Bitmap As Bitmap
   Dim cleide_Bitmap As Bitmap
   Dim cristina_Bitmap As Bitmap
   Dim crystal_freitas_Bitmap As Bitmap
   Dim daniela_Bitmap As Bitmap
   Dim dany_tavares_Bitmap As Bitmap
   Dim diana_isabel_Bitmap As Bitmap
   Dim elisabete_Bitmap As Bitmap
   Dim estrella_Bitmap As Bitmap
   Dim fabiana_guedes_Bitmap As Bitmap
   Dim fernanda_bettencourt_Bitmap As Bitmap
   Dim fernanda_Bitmap As Bitmap
   Dim filipa_goncalves_Bitmap As Bitmap
   Dim filipinha_Bitmap As Bitmap
   Dim gabriela_paixao_Bitmap As Bitmap
   Dim giovanna_Bitmap As Bitmap
   Dim helena_Bitmap As Bitmap
   Dim ines_Bitmap As Bitmap
   Dim inka_Bitmap As Bitmap
   Dim isabella_maserati_Bitmap As Bitmap
   Dim isadora_Bitmap As Bitmap
   Dim jessica_Bitmap As Bitmap
   Dim joana_salgado_Bitmap As Bitmap
   Dim juliana_Bitmap As Bitmap
   Dim katia_Bitmap As Bitmap
   Dim kyara_Bitmap As Bitmap
   Dim lais_Bitmap As Bitmap
   Dim laura_godini_Bitmap As Bitmap
   Dim leticia_Bitmap As Bitmap
   Dim liliana_aventura_Bitmap As Bitmap
   Dim liliana_queiroz_Bitmap As Bitmap
   Dim lorena_paes_Bitmap As Bitmap
   Dim manu_Bitmap As Bitmap
   Dim marta_Bitmap As Bitmap
   Dim michelle_andrade_Bitmap As Bitmap
   Dim mila_Bitmap As Bitmap
   Dim monika_Bitmap As Bitmap
   Dim nadia_Bitmap As Bitmap
   Dim natasha_Bitmap As Bitmap
   Dim natasha_cardoso_Bitmap As Bitmap
   Dim nelisa_Bitmap As Bitmap
   Dim nicole_andrade_Bitmap As Bitmap
   Dim nicole_guimaraes_Bitmap As Bitmap
   Dim nurya_Bitmap As Bitmap
   Dim paola_mendes_Bitmap As Bitmap
   Dim patricia_sousa_Bitmap As Bitmap
   Dim patricia_telles_Bitmap As Bitmap
   Dim patty_Bitmap As Bitmap
   Dim paula_mendes_Bitmap As Bitmap
   Dim paula_nobre_Bitmap As Bitmap
   Dim raissa_Bitmap As Bitmap
   Dim raquel_santana_Bitmap As Bitmap
   Dim rita_Bitmap As Bitmap
   Dim safira_Bitmap As Bitmap
   Dim sara_santos_Bitmap As Bitmap
   Dim sefora_Bitmap As Bitmap
   Dim sofia_castro_Bitmap As Bitmap
   Dim stefany_Bitmap As Bitmap
   Dim susan_jolie_Bitmap As Bitmap
   Dim susana_Bitmap As Bitmap
   Dim tasha_Bitmap As Bitmap
   Dim thays_Bitmap As Bitmap
   Dim vitoria_lima_Bitmap As Bitmap
   Dim yara_Bitmap As Bitmap
   Dim yolanda_Bitmap As Bitmap



    aline_Bitmap.Initialize(File.DirAssets, "aline_icon.jpg")
   ana_mendes_Bitmap.Initialize(File.DirAssets, "ana_mendes_icon.jpg")
   beatriz_Bitmap.Initialize(File.DirAssets, "beatriz_icon.jpg")
   bela_melo_Bitmap.Initialize(File.DirAssets, "bela_melo_icon.jpg")
   bianca_Bitmap.Initialize(File.DirAssets, "bianca_icon.jpg")
   brenna_Bitmap.Initialize(File.DirAssets, "brenna_icon.jpg")
   bruna_Bitmap.Initialize(File.DirAssets, "bruna_icon.jpg")
   carina_almeida_Bitmap.Initialize(File.DirAssets, "carina_almeida_icon.jpg")
   catarina_Bitmap.Initialize(File.DirAssets, "catarina_icon.jpg")
   cleide_Bitmap.Initialize(File.DirAssets, "cleide_icon.jpg")
   cristina_Bitmap.Initialize(File.DirAssets, "cristina_icon.jpg")
   crystal_freitas_Bitmap.Initialize(File.DirAssets, "crystal_freitas_icon.jpg")
   daniela_Bitmap.Initialize(File.DirAssets, "daniela_icon.jpg")
   dany_tavares_Bitmap.Initialize(File.DirAssets, "dany_tavares_icon.jpg")
   diana_isabel_Bitmap.Initialize(File.DirAssets, "diana_isabel_icon.jpg")
   elisabete_Bitmap.Initialize(File.DirAssets, "elisabete_icon.jpg")
   estrella_Bitmap.Initialize(File.DirAssets, "estrella_icon.jpg")
   fabiana_guedes_Bitmap.Initialize(File.DirAssets, "fabiana_guedes_icon.jpg")
   fernanda_bettencourt_Bitmap.Initialize(File.DirAssets, "fernanda_bettencourt_icon.jpg")
   fernanda_Bitmap.Initialize(File.DirAssets, "fernanda_icon.jpg")
   filipa_goncalves_Bitmap.Initialize(File.DirAssets, "filipa_goncalves_icon.jpg")
   filipinha_Bitmap.Initialize(File.DirAssets, "filipinha_icon.jpg")
   gabriela_paixao_Bitmap.Initialize(File.DirAssets, "gabriela_paixao_icon.jpg")
   giovanna_Bitmap.Initialize(File.DirAssets, "giovanna_icon.jpg")
   helena_Bitmap.Initialize(File.DirAssets, "helena_icon.jpg")
   ines_Bitmap.Initialize(File.DirAssets, "ines_icon.jpg")
   inka_Bitmap.Initialize(File.DirAssets, "inka_icon.jpg")
   isabella_maserati_Bitmap.Initialize(File.DirAssets, "isabella_maserati_icon.jpg")
   isadora_Bitmap.Initialize(File.DirAssets, "isadora_icon.jpg")
   jessica_Bitmap.Initialize(File.DirAssets, "jessica_icon.jpg")
   joana_salgado_Bitmap.Initialize(File.DirAssets, "joana_salgado_icon.jpg")
   juliana_Bitmap.Initialize(File.DirAssets, "juliana_icon.jpg")
   katia_Bitmap.Initialize(File.DirAssets, "katia_icon.jpg")
   kyara_Bitmap.Initialize(File.DirAssets, "kyara_icon.jpg")
   lais_Bitmap.Initialize(File.DirAssets, "lais_icon.jpg")
   laura_godini_Bitmap.Initialize(File.DirAssets, "laura_godini_icon.jpg")
   leticia_Bitmap.Initialize(File.DirAssets, "leticia_icon.jpg")
   liliana_aventura_Bitmap.Initialize(File.DirAssets, "liliana_aventura_icon.jpg")
   liliana_queiroz_Bitmap.Initialize(File.DirAssets, "liliana_queiroz_icon.jpg")
   lorena_paes_Bitmap.Initialize(File.DirAssets, "lorena_paes_icon.jpg")
   manu_Bitmap.Initialize(File.DirAssets, "manu_icon.jpg")
   marta_Bitmap.Initialize(File.DirAssets, "marta_icon.jpg")
   michelle_andrade_Bitmap.Initialize(File.DirAssets, "michelle_andrade_icon.jpg")
   mila_Bitmap.Initialize(File.DirAssets, "mila_icon.jpg")
   monika_Bitmap.Initialize(File.DirAssets, "monika_icon.jpg")
   nadia_Bitmap.Initialize(File.DirAssets, "nadia_icon.jpg")
   natasha_Bitmap.Initialize(File.DirAssets, "natasha_icon.jpg")
   natasha_cardoso_Bitmap.Initialize(File.DirAssets, "natasha_cardoso_icon.jpg")
   nelisa_Bitmap.Initialize(File.DirAssets, "nelisa_icon.jpg")
   nicole_andrade_Bitmap.Initialize(File.DirAssets, "nicole_andrade_icon.jpg")
   nicole_guimaraes_Bitmap.Initialize(File.DirAssets, "nicole_guimaraes_icon.jpg")
   nurya_Bitmap.Initialize(File.DirAssets, "nurya_icon.jpg")
   paola_mendes_Bitmap.Initialize(File.DirAssets, "paola_mendes_icon.jpg")
   patricia_sousa_Bitmap.Initialize(File.DirAssets, "patricia_sousa_icon.jpg")
   patricia_telles_Bitmap.Initialize(File.DirAssets, "patricia_telles_icon.jpg")
   patty_Bitmap.Initialize(File.DirAssets, "patty_icon.jpg")
   paula_mendes_Bitmap.Initialize(File.DirAssets, "paula_mendes_icon.jpg")
   paula_nobre_Bitmap.Initialize(File.DirAssets, "paula_nobre_icon.jpg")
   raissa_Bitmap.Initialize(File.DirAssets, "raissa_icon.jpg")
   raquel_santana_Bitmap.Initialize(File.DirAssets, "raquel_santana_icon.jpg")
   rita_Bitmap.Initialize(File.DirAssets, "rita_icon.jpg")
   safira_Bitmap.Initialize(File.DirAssets, "safira_icon.jpg")
   sara_santos_Bitmap.Initialize(File.DirAssets, "sara_santos_icon.jpg")
   sefora_Bitmap.Initialize(File.DirAssets, "sefora_icon.jpg")
   sofia_castro_Bitmap.Initialize(File.DirAssets, "sofia_castro_icon.jpg")
   stefany_Bitmap.Initialize(File.DirAssets, "stefany_icon.jpg")
   susan_jolie_Bitmap.Initialize(File.DirAssets, "susan_jolie_icon.jpg")
   susana_Bitmap.Initialize(File.DirAssets, "susana_icon.jpg")
   tasha_Bitmap.Initialize(File.DirAssets, "tasha_icon.jpg")
   thays_Bitmap.Initialize(File.DirAssets, "thays_icon.jpg")
   vitoria_lima_Bitmap.Initialize(File.DirAssets, "vitoria_lima_icon.jpg")
   yara_Bitmap.Initialize(File.DirAssets, "yara_icon.jpg")
   yolanda_Bitmap.Initialize(File.DirAssets, "yolanda_icon.jpg")



   ListView1.SingleLineLayout.ItemHeight = 100dip
    ListView1.SingleLineLayout.Label.TextSize = 20
    ListView1.SingleLineLayout.Label.TextColor = Colors.Blue
    ListView1.SingleLineLayout.Label.Gravity = Gravity.CENTER
   ListView1.FastScrollEnabled = True



   ListView1.AddTwoLinesAndBitmap("Aline", "Atende só Homens / Sexo Oral e Vaginal / 19 Anos", aline_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Ana Mendes", "Atende só Homens / Sexo Oral e Vaginal / 26 Anos", ana_mendes_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Beatriz", "Atende só Homens / Sexo Oral e Vaginal / 20 Anos", beatriz_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Bela Melo", "Atende só Homens / Sexo Oral e Vaginal / 24 Anos", bela_melo_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Bianca", "Atende só Homens / Sexo Oral e Vaginal / 19 Anos", bianca_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Brenna", "Atende só Homens / Sexo Completo / 19 Anos", brenna_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Bruna", "Atende só Homens / Sexo Oral e Vaginal / 29 Anos", bruna_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Carina de Almeida", "Atende só Homens / Sexo Oral e Vaginal / 27 Anos", carina_almeida_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Catarina", "Atende só Homens / Sexo Oral e Vaginal / 27 Anos", catarina_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Cleide", "Atende só Homens / Sexo Oral e Vaginal / 27 Anos", cleide_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Cristina", "Atende só Homens / Sexo Oral e Vaginal / 30 Anos", cristina_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Crystal Freitas", "Atende só Homens / Sexo Oral e Vaginal / 24 Anos", crystal_freitas_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Daniela", "Atende só Homens / Sexo Oral e Vaginal / 25 Anos", daniela_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Dany Tavares", "Atende Homens e Casais / Sexo Oral e Vaginal / 27 Anos", dany_tavares_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Diana Isabel", "Atende só Homens / Sexo Oral e Vaginal / 22 Anos", diana_isabel_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Elisabete (Nikita)", "Atende só Homens / Sexo Oral e Vaginal / 23 Anos", elisabete_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Estrella", "Atende só Homens / Sexo Oral e Vaginal / 22 Anos", estrella_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Fabiana Guedes", "Atende só Homens / Sexo Oral e Vaginal / 30 Anos", fabiana_guedes_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Fernanda", "Atende só Homens / Sexo Oral e Vaginal / 26 Anos", fernanda_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Fernanda Bettencourt", "Atende só Homens / Sexo Oral e Vaginal / 24 Anos", fernanda_bettencourt_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Filipa Gonçalves", "Atende só Homens / Sexo Oral e Vaginal / 19 Anos", filipa_goncalves_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Filipinha", "Atende só Homens / Sexo Oral e Vaginal / 18 Anos", filipinha_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Gabriela Paixão", "Atende só Homens / Sexo Oral e Vaginal / 21 Anos", gabriela_paixao_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Giovanna", "Atende só Homens / Sexo Oral e Vaginal / 26 Anos", giovanna_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Helena", "Atende só Homens / Sexo Oral e Vaginal / 29 Anos", helena_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Inês", "Atende só Homens / Sexo Oral e Vaginal / 23 Anos", ines_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Inka", "Atende só Homens / Sexo Oral e Vaginal / 22 Anos", inka_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Isabella Maserati", "Atende só Homens / Sexo Oral e Vaginal / 22 Anos", isabella_maserati_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Isadora", "Atende só Homens / Sexo Oral e Vaginal / 21 Anos", isadora_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Jessica", "Atende só Homens / Sexo Oral e Vaginal / 20 Anos", jessica_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Joana Salgado", "Atende só Homens / Sexo Oral e Vaginal / 21 Anos", joana_salgado_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Juliana", "Atende só Homens / Sexo Oral e Vaginal / 19 Anos", juliana_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Kátia", "Atende só Homens / Sexo Oral e Vaginal / 18 Anos", katia_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Kyara", "Atende só Homens / Sexo Oral e Vaginal / 31 Anos", kyara_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Lais", "Atende só Homens / Sexo Oral e Vaginal / 20 Anos", lais_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Laura Godini", "Atende só Homens / Sexo Oral e Vaginal / 21 Anos", laura_godini_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Letícia", "Atende só Homens / Sexo Oral e Vaginal / 18 Anos", leticia_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Liliana Aventura", "Atende só Homens / Sexo Oral e Vaginal / 21 Anos", liliana_aventura_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Liliana Queiróz", "Atende só Homens / Sexo Oral e Vaginal / 27 Anos", liliana_queiroz_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Lorena Paes", "Atende só Homens / Sexo Oral e Vaginal / 22 Anos", lorena_paes_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Manu *Luna*", "Atende só Homens / Sexo Completo / 19 Anos", manu_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Marta", "Atende só Homens / Sexo Oral e Vaginal / 40 Anos", marta_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Michelle Andrade", "Atende só Homens / Sexo Oral e Vaginal / 25 Anos", michelle_andrade_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Mila", "Atende só Homens / Sexo Oral e Vaginal / 28 Anos", mila_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Monika", "Atende só Homens / Sexo Oral e Vaginal / 31 Anos", monika_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Nadia", "Atende só Homens / Sexo Oral e Vaginal / 28 Anos", nadia_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Natasha Cardoso", "Atende só Homens / Sexo Oral e Vaginal / 28 Anos", natasha_cardoso_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Natasha", "Atende só Homens / Sexo Oral e Vaginal / 26 Anos", natasha_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Nelisa", "Atende só Homens / Sexo Oral e Vaginal / 24 Anos", nelisa_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Nicole Andrade", "Atende só Homens / Sexo Oral e Vaginal / 24 Anos", nicole_andrade_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Nicole Guimarães", "Atende só Homens / Sexo Oral e Vaginal / 26 Anos", nicole_guimaraes_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Nurya", "Atende só Homens / Sexo Oral e Vaginal / 25 Anos", nurya_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Paola Mendes", "Atende só Homens / Sexo Oral e Vaginal / 21 Anos", paola_mendes_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Patrícia Sousa", "Atende só Homens / Sexo Oral e Vaginal / 20 Anos", patricia_sousa_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Patrícia Telles", "Atende só Homens / Sexo Oral e Vaginal / 23 Anos", patricia_telles_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Patty", "Atende só Homens / Sexo Oral e Vaginal / 25 Anos", patty_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Paula Mendes", "Atende só Homens / Sexo Oral e Vaginal / 23 Anos", paula_mendes_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Paula Nobre", "Atende só Homens / Sexo Oral e Vaginal / 25 Anos", paula_nobre_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Raíssa", "Atende só Homens / Sexo Oral e Vaginal / 22 Anos", raissa_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Raquel Santana", "Atende só Homens / Sexo Oral e Vaginal / 24 Anos", raquel_santana_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Rita", "Atende só Homens / Sexo Oral e Vaginal / 30 Anos", rita_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Safira", "Atende só Homens / Sexo Oral e Vaginal / 22 Anos", safira_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Sara Santos", "Atende Homens e Casais / Sexo Completo / 21 Anos", sara_santos_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Séfora", "Atende Homens e Casais / Sexo Completo / 25 Anos", sefora_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Sofia Castro", "Atende só Homens / Sexo Oral e Vaginal / 34 Anos", sofia_castro_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Stefany", "Atende só Homens / Sexo Oral e Vaginal / 20 Anos", stefany_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Susan Jolie", "Atende só Homens / Sexo Oral e Vaginal / 26 Anos", susan_jolie_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Susana", "Atende só Homens / Sexo Oral e Vaginal / 19 Anos", susana_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Tasha", "Atende só Homens / Sexo Oral e Vaginal / 19 Anos", tasha_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Thays", "Atende só Homens / Sexo Completo / 27 Anos", thays_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Vitória Lima", "Atende só Homens / Sexo Oral e Vaginal / 20 Anos", vitoria_lima_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Yara", "Atende só Homens / Sexo Completo / 18 Anos", yara_Bitmap)
   ListView1.AddTwoLinesAndBitmap("Yolanda", "Atende só Homens / Sexo Oral e Vaginal / 19 Anos", yolanda_Bitmap)

  
  
  
  
  
  
    Activity.AddView(ListView1, 0, 0, 100%x, 100%y)
End Sub


Sub ListView1_ItemClick (Position As Int, Value As Object)
      Mediaplayer1.Initialize
      MediaPlayer1.Load(File.DirAssets, "Click1.wav")
      MediaPlayer1.Play
      
   If Position = 0 Then StartActivity(Aline)
   If Position = 1 Then StartActivity(AnaMendes)
   If Position = 2 Then StartActivity(Beatriz)
   If Position = 3 Then StartActivity(BelaMelo)
   If Position = 4 Then StartActivity(Bianca)
   If Position = 5 Then StartActivity(Brenna)
   If Position = 6 Then StartActivity(Bruna)
   If Position = 7 Then StartActivity(CarinaAlmeida)
   If Position = 8 Then StartActivity(Catarina)
   If Position = 9 Then StartActivity(Cleide)
   If Position = 10 Then StartActivity(Cristina)
   If Position = 11 Then StartActivity(CrystalFreitas)
   If Position = 12 Then StartActivity(Daniela)
   If Position = 13 Then StartActivity(DanyTavares)
   If Position = 14 Then StartActivity(DianaIsabel)
   If Position = 15 Then StartActivity(Elisabete)
   If Position = 16 Then StartActivity(Estrella)
   If Position = 17 Then StartActivity(FabianaGuedes)
   If Position = 18 Then StartActivity(Fernanda)
   If Position = 19 Then StartActivity(FernandaBettencourt)
   If Position = 20 Then StartActivity(FilipaGoncalves)
   If Position = 21 Then StartActivity(Filipinha)
   If Position = 22 Then StartActivity(GabrielaPaixao)
   If Position = 23 Then StartActivity(Giovanna)
   If Position = 24 Then StartActivity(Helena)
   If Position = 25 Then StartActivity(Ines)
   If Position = 26 Then StartActivity(Inka)
   If Position = 27 Then StartActivity(IsabellaMaserati)
   If Position = 28 Then StartActivity(Isadora)
   If Position = 29 Then StartActivity(Jessica)
   If Position = 30 Then StartActivity(JoanaSalgado)
   If Position = 31 Then StartActivity(Juliana)
   If Position = 32 Then StartActivity(Katia)
   If Position = 33 Then StartActivity(Kyara)
   If Position = 34 Then StartActivity(Lais)
   If Position = 35 Then StartActivity(LauraGodini)
   If Position = 36 Then StartActivity(Leticia)
   If Position = 37 Then StartActivity(LilianaAventura)
   If Position = 38 Then StartActivity(LilianaQueiroz)
   If Position = 39 Then StartActivity(LorenaPaes)
   If Position = 40 Then StartActivity(Manu)
   If Position = 41 Then StartActivity(Marta)
   If Position = 42 Then StartActivity(MichelleAndrade)
   If Position = 43 Then StartActivity(Mila)
   If Position = 44 Then StartActivity(Monika)
   If Position = 45 Then StartActivity(Nadia)
   If Position = 46 Then StartActivity(Natasha)
   If Position = 47 Then StartActivity(NatashaCardoso)
   If Position = 48 Then StartActivity(Nelisa)
   If Position = 49 Then StartActivity(NicoleAndrade)
   If Position = 50 Then StartActivity(NicoleGuimaraes)
   If Position = 51 Then StartActivity(Nurya)
   If Position = 52 Then StartActivity(PaolaMendes)
   If Position = 53 Then StartActivity(PatriciaSousa)
   If Position = 54 Then StartActivity(PatriciaTelles)
   If Position = 55 Then StartActivity(Patty)
   If Position = 56 Then StartActivity(PaulaMendes)
   If Position = 57 Then StartActivity(PaulaNobre)
   If Position = 58 Then StartActivity(Raissa)
   If Position = 59 Then StartActivity(RaquelSantana)
   If Position = 60 Then StartActivity(Rita)
   If Position = 61 Then StartActivity(Safira)
   If Position = 62 Then StartActivity(SaraSantos)
'   If Position = 63 Then StartActivity(Sefora)
'   If Position = 64 Then StartActivity(SofiaCastro)
'   If Position = 65 Then StartActivity(Stefany)
'   If Position = 66 Then StartActivity(SusanJolie)
'   If Position = 67 Then StartActivity(Susana)
'   If Position = 68 Then StartActivity(Tasha)
'   If Position = 69 Then StartActivity(Thays)
'   If Position = 70 Then StartActivity(VitoriaLima)
'   If Position = 71 Then StartActivity(Yara)
'   If Position = 72 Then StartActivity(Yolanda)
'   
   
   
   

   
   
   
   

   
   
   
   
End Sub


Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


If I unquote the "' If Position = 63 Then StartActivity(Sefora)" or any other down this line and put the appropriate modules by "Add existing Module" the application gives me that error. after I take out those modules that were crashing the appz, the application compiles ok.

Is this some kind of limit in the modules ?, it's weird that this happen when I add one more, and I already create new modules to substitute for the older ones that perhaps had some kind of file problem, but no, the problem persists :(

Any ideas of what the problem could be in this case ?

This line "if Position = 63 Then StartActivity(Sefora)" calls this activity:

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   Dim MediaPlayer1 As MediaPlayer

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim scvImages As ScrollView
   Dim imvImage As ImageView
   Dim bmpImage As Bitmap
   Dim lblImage As Label
   Dim imgWidth As Int         : imgWidth=480dip      ' image width
   Dim imgHeight As Int      : imgHeight=320dip   ' image height
   Dim imgSpace As Int         : imgSpace=5dip         ' space between images
   Dim nbrImage As Int         : nbrImage=4            ' number of images beginning with 0
   Dim lfmImage As Int                                       ' left margin of images
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("sefora")         ' loads the layout file
   lfmImage=(scvImages.Width-imgWidth)/2         ' calculates the left margin
   InitScrollView                                             ' inits the ScrollView
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub InitScrollView
   Dim i As Int
   
   For i=0 To 4
      Dim imvImage As ImageView                                                         
      Dim bmpImage As Bitmap
      bmpImage.Initialize(File.DirAssets,"sefora"&i&".jpg")
'      bmpImage.Initialize(File.DirInternal,"Image"&i&".jpg")
'      bmpImage.Initialize(File.DirDefaultExternal,"Image"&i&".jpg")
      imvImage.Initialize("imvImage")
      imvImage.Gravity=Gravity.FILL
      imvImage.Tag=i
      imvImage.Bitmap=bmpImage
      scvImages.Panel.AddView(imvImage,lfmImage,i*(imgHeight+imgSpace),imgWidth,imgHeight)
   Next
   scvImages.Panel.Height=(nbrImage+1)*(imgHeight+imgSpace)
End Sub

Sub imvImage_Click
      Mediaplayer1.Initialize
      MediaPlayer1.Load(File.DirAssets, "Click1.wav")
      MediaPlayer1.Play
      
   StartActivity(SeforaContactos)
   
End Sub

And this activity calls this:

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   Dim MediaPlayer1 As MediaPlayer   
End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("seforacontactos")         ' loads the layout file

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


Sub Button1_Click
      Mediaplayer1.Initialize
      MediaPlayer1.Load(File.DirAssets, "Click1.wav")
      MediaPlayer1.Play
    

      Dim p As PhoneCalls
            
      If Msgbox2("Deseja ligar ?", "", "Sim", "", "Não", Null) = DialogResponse.POSITIVE Then
        'make call
      
      StartActivity(p.Call("123456789"))
            
    End If
   
End Sub

Sub ReviewButton1_Click
      Mediaplayer1.Initialize
      MediaPlayer1.Load(File.DirAssets, "Click1.wav")
      MediaPlayer1.Play
    
      StartActivity(SeforaReview)
      
      
End Sub

And this activity calls this one last:

B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("seforareview")         ' loads the layout file

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub


So this big activity has 72 sub activities each one with 3 sub activities under them, totalling:

72*3 = 216 Activities just this Module. should be this a problem ?

Help appreciated. thanks in advance.

Joel
 
Upvote 0

Joel Fonseca

Member
Licensed User
Longtime User
Erel, that was the first thing i disabled, and still keeps giving me the error, is there anyway i can make my appz lighter in code or something like that, putting activities together in a module and keep the idea of this app ?

help appreaciated :)

thanks in advance

Joel
 
Upvote 0

Joel Fonseca

Member
Licensed User
Longtime User
Nice, i am new to coding, can you post a small example of what i need following my program line ?, i would really appreciate it :)

Thanks

Joel
 
Upvote 0

Rui

Member
Licensed User
Longtime User
Parece ser um programa interessante;)

Penso que é melhor haver uma separação entre o programa e os dados.
Talvez fosse mais logico guardar fotos e contactos numa base de dados assim nao era necessario actualizar o programa sempre que houvessem alterações.

I think it is better to separate the program from the data
It might be more logical to store photos and contacts in a database so it was not necessary to update the program whenever contacts changes.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Concordo com o Rui, as imagens (fotos) seria bem masi logico estar numa bas dados como BLOB...

Para ambos deixo aqui este link que pode ter passado despercebido:

I agree with Rui, for the photos a database would be more suitable, and have them saved as BLOB

For both of you I leave this link that may pass un-noticed
Forum Tuga
 
Upvote 0

Joel Fonseca

Member
Licensed User
Longtime User
It seems like you can optimize your code a lot. For example you can put the activities names in an array and then write:
B4X:
StartActivity(ActivitiesArray(position))
Instead of all the ifs. You can also load the data from a file. In almost all cases repeated code is not needed and can be optimized.

Hi Erel, about this question, could you write me down a little of the code so i can use it, thanks in advance,

Joel
 
Upvote 0

chuckw

New Member
Licensed User
Longtime User
B4A version: 5.02 (1)
Parsing code. (0.00s)
Compiling code. (2.02s)
Compiling layouts code. (0.22s)
Generating R file. (1.14s)
Compiling generated Java code. Error

Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap

I get the above error when trying to compile even example code (TestLayouts)

I already tried increasing MaxRamForDex:
MaxRamForDex=1536

Any suggestions?

Chuck
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

chuckw

New Member
Licensed User
Longtime User
OK. Sorry. Looks like the problem was related to a specific computer. Next time I need help I will start a new thread.
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
After adding Google Play Services and FusedLocationProvider Libs to my project, Today, I too had the same problem ie

Convert byte code - optimized dex. Error

The error screen suggested me to increase the timeout value using the Menu, Tools-IDE Options-> Configure Process TimeOut. I increased the Timeout value from the default value of 30 to 60, unfortunately this did not resolve the issue.

My PC runs on Windows 10 Pro (64Bit) with 4GB RAM

I was able to resolve the error by using the methods suggested by Erel in this thread ie by increasing the value of MaxRamForDex in the INI files available in the folder

C:\Users\<UserName>\AppData\Roaming\AnyWhere Software\Basic4Android\b4xV5.ini
C:\Users\<UserName>\AppData\Roaming\AnyWhere Software\Basic4Android\b4aV0.1.ini

May be you need not modify the value in the second INI file, not sure

I increased the value of MaxRamForDex from 512 to 1024, and the problem got resolved. :)
MaxRamForDex=1024

Thanks & Regards
Anser
 
Upvote 0
Top