Android Question problems compiling references

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hello to all
I changed my PC and I had to install everything in the development and configuration environment.
With the new version, it gives me problems that I did not have before, even following all the instructions.

Here is the mistake:

B4X:
B4A Version: 7.80
Parsing code.    (1.37s)
Compiling code.    (3.40s)
Compiling layouts code.    (0.50s)
Organizing libraries.    (2.68s)
Generating R file.    (0.68s)
Compiling generated Java code.    (14.30s)
Convert byte code - optimized dex.    Error
trouble writing output: Too many field references: 73099; max is 65536.
You may try using --multi-dex option.
References by package:
    26 android.app
    14 android.arch.core.internal
    55 android.arch.lifecycle
    25 android.content.pm
    10 android.content.res
    49 android.graphics
     2 android.graphics.drawable
     6 android.hardware
     2 android.media
     1 android.media.browse
     2 android.net
    12 android.os
     3 android.print
    12 android.provider
    13 android.support.annotation
  2175 android.support.compat
     6 android.support.coreui
     6 android.support.coreutils
  2175 android.support.design
   106 android.support.design.internal
   655 android.support.design.widget
     6 android.support.fragment
   213 android.support.graphics.drawable
     6 android.support.graphics.drawable.animated
  2175 android.support.mediacompat
  2569 android.support.transition
     6 android.support.v4
    11 android.support.v4.accessibilityservice
   932 android.support.v4.app
   106 android.support.v4.content
    13 android.support.v4.content.pm
    20 android.support.v4.content.res
    50 android.support.v4.graphics
    56 android.support.v4.graphics.drawable
     4 android.support.v4.hardware.display
     6 android.support.v4.hardware.fingerprint
    11 android.support.v4.internal.view
   434 android.support.v4.media
     8 android.support.v4.media.app
   377 android.support.v4.media.session
     5 android.support.v4.net
    37 android.support.v4.os
    52 android.support.v4.print
   100 android.support.v4.provider
    51 android.support.v4.text
     6 android.support.v4.text.util
   119 android.support.v4.util
   412 android.support.v4.view
   118 android.support.v4.view.accessibility
     8 android.support.v4.view.animation
   477 android.support.v4.widget
   396 android.support.v7.app
  2175 android.support.v7.appcompat
     8 android.support.v7.content.res
    18 android.support.v7.graphics.drawable
  2175 android.support.v7.recyclerview
     1 android.support.v7.text
   124 android.support.v7.util
    85 android.support.v7.view
   270 android.support.v7.view.menu
  1546 android.support.v7.widget
    89 android.support.v7.widget.helper
     1 android.support.v7.widget.util
     1 android.system
     7 android.text
     1 android.text.util
    13 android.util
    28 android.view
    10 android.view.accessibility
     1 android.view.inputmethod
    18 android.widget
   131 anywheresoftware.b4a
     3 anywheresoftware.b4a.agraham.byteconverter
   158 anywheresoftware.b4a.agraham.dialogs
    25 anywheresoftware.b4a.agraham.reflection
    13 anywheresoftware.b4a.agraham.threading
    62 anywheresoftware.b4a.audio
    13 anywheresoftware.b4a.gps
    24 anywheresoftware.b4a.http
    94 anywheresoftware.b4a.keywords
   125 anywheresoftware.b4a.keywords.constants
   115 anywheresoftware.b4a.net
     4 anywheresoftware.b4a.object
   434 anywheresoftware.b4a.objects
    14 anywheresoftware.b4a.objects.collections
    15 anywheresoftware.b4a.objects.drawable
     3 anywheresoftware.b4a.objects.streams
   173 anywheresoftware.b4a.phone
    76 anywheresoftware.b4a.randomaccessfile
    30 anywheresoftware.b4a.samples.httputils2
    13 anywheresoftware.b4a.sql
    29 anywheresoftware.b4h.okhttp
    15 anywheresoftware.b4j.object
     8 barkernetdesign.customnotification
    35 com.astuetz
     5 com.rootsoft.customtoast
    61 com.rootsoft.rsswipetodismiss
   133 com.starmicronics.stario
  2189 com.wdullaer.materialdatetimepicker
   225 com.wdullaer.materialdatetimepicker.date
   251 com.wdullaer.materialdatetimepicker.time
     9 com.wrapp.floatlabelededittext
     4 de.amberhome.dashboard
    47 de.amberhome.locale
    44 de.amberhome.objects
  2239 de.amberhome.objects.appcompat
  2169 de.amberhome.objects.designsupport
    15 de.amberhome.viewpager
   100 de.amberhome.viewpager.internal
    46 de.donmanfred
   102 de.tavendo.autobahn
 40934 dev.meta.sb
    25 edsmith.calendar
    29 flm.b4a.scrollview2d
   116 it.csinet.xnObjects
    13 it.csinet.xnObjectsTest
     1 java.io
    13 java.lang
    11 java.lang.annotation
     9 java.net
     2 java.nio
     1 java.nio.channels
    23 java.util
     4 java.util.concurrent
     3 java.util.logging
    11 njdude.barcodegenerator.sample
     5 njdude.skype.library.sample
   458 okhttp3
    21 okhttp3.internal
    78 okhttp3.internal.cache
    23 okhttp3.internal.cache2
    42 okhttp3.internal.connection
    31 okhttp3.internal.http
    34 okhttp3.internal.http1
   211 okhttp3.internal.http2
    42 okhttp3.internal.huc
     1 okhttp3.internal.io
    29 okhttp3.internal.platform
    15 okhttp3.internal.tls
    90 okhttp3.internal.ws
   102 okio
    33 org.apache.commons.net
   310 org.apache.commons.net.ftp
    54 org.apache.commons.net.ftp.parser
    46 org.apache.commons.net.io
    61 org.apache.commons.net.pop3
    85 org.apache.commons.net.smtp
    44 org.apache.commons.net.util
     1 org.apache.http.conn.ssl
    17 org.apache.james.mime4j.codec
     9 org.apache.james.mime4j.util
     1 org.json
    13 uk.co.martinpearman.b4a.location
    11 uk.co.martinpearman.b4a.webviewextras
    76 xvs.ACL


I tried to change the parameters of the end b4xv5.ini:

UseOptimizedDexer=True

MaxRamForDex=3072
NumberOfRecentFiles=12
NumberOfRecentSearches=20
OptimizedDexerPort=31161
PlatformFolder=C:\Android\platforms\android-27
ProcessesTimeoutSeconds=600
ProxyHost=
ProxyPort=

I precise that use Java 9
JavaBin=C:\Program Files\Java\jdk-9.0.4\bin

Thank in advance
 

DonManfred

Expert
Licensed User
Longtime User
Maybe the problem is in using Java 9. B4A is designed to use Java 8

Maybe it just helps using
B4X:
#MultiDex: true
in your main projectcode..
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
Maybe the problem is in using Java 9. B4A is designed to use Java 8

Maybe it just helps using
B4X:
#MultiDex: true
in your main projectcode..
I thought I had read in the last few notes that B4A 7.8 supported Java 9.

with the #MultiDex parameter: true works.

thanks for help
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
It's compile, but have this error:

Convert byte code - optimized dex. (12.04s)
Optimized dexer failed. Switching to Standard dexer.

What could it be?
thank
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
ok Erel. I repeat what I wrote in another post, that the compilation is slow: 40 seconds, with Windows 10, MacBookPro 15 '', SSD, Core I7 processor!
thank you
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
Erel, maybe I did not understand what you mean. But they are all files of the program and not data. Not being able to divide the program into separate modules, because there is the problem of graphic resources, the size of the program becomes large.
 
Upvote 0

Roberto P.

Well-Known Member
Licensed User
Longtime User
Hello
I'm not sure I understood correctly.
I specify that I have many activities, classes, modules and script designers. I do not know how I could optimize all this. I have developed libraries to handle .B.L functions. (Business Logic) independent of the activities.

We accept tips and suggestions.
 
Upvote 0
Top