Android Question "error: too many constants"

Discussion in 'Android Questions' started by kepler, Mar 19, 2015.

  1. kepler

    kepler Active Member Licensed User

    Good evening,

    After a hard work, and saving a prototype project in B4A without any problems, when I try to compile it I get the message:

    javac 1.7.0_60
    src\programs\almagest\module2.java:7: error: too many constants
    public class planets {
    ^
    1 error


    Is there any limit in a static module that I'm not aware?

    Kind regards,

    Kepler
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the code in this module?
     
  3. kepler

    kepler Active Member Licensed User

    Good morning Erel :)

    I've figured it out.
    I was trying to compile a module with 1.99 MB!!!
    Not a good idea...
    So I've made separated modules, and the problem was gone.
    Also, I had a memory problem - solved changing the value in the B4A ini file: MaxRamForDex=1536
    And... had some freezing problems also, because I declared an array as Dim nArray(0 to 2) instead of Dim nArray(3) - only troubles...

    Kind regards,

    Kepler
     
  4. Rick Harris

    Rick Harris Well-Known Member Licensed User

    Where is this "B4A ini file"? It is not in the B4A Program Files directory.
     
  5. DonManfred

    DonManfred Expert Licensed User

    C:\Users\[user]\AppData\Roaming\Anywhere Software\Basic4android
     
    Rick Harris likes this.
  6. Rick Harris

    Rick Harris Well-Known Member Licensed User

    In Debug (Legacy) mode I also still get a "Too Many Constants" error.
    I have understood that the maximum number of constants is 65365.
    Can someone please explain how to count the constants?
    Better still: can B4A do a constants count?
    Why does this problem not occur in Release mode? I.e. how many constants does the Debugger add to the total count?
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice