Android Question CODE TOO LARGE Error Message

Discussion in 'Android Questions' started by Sanjaya, Feb 10, 2015.

  1. Sanjaya

    Sanjaya Member Licensed User

    Hi guys,

    Thank you Erel for pointing in the right direction - worked BUT THEN this:

    Compiling generated Java code. Error
    B4A line: 3659
    End Sub
    javac 1.7.0_76
    src\sanjaya\app\calculation.java:10536: error: code too large for try statement
    catch (Exception e) {
    ^
    1 error

    What does it mean and any way to fix this?

    Sanjaya
     
  2. lemonisdead

    lemonisdead Well-Known Member Licensed User

    Hello,

    Erel said that the limit is 64 Kb set by Java. Were you in debug mode ?
    The solution seems to be : break the code in smaller parts
     
    thedesolatesoul and NJDude like this.
  3. NJDude

    NJDude Expert Licensed User

    The error you mentioned means the code you have in your TRY...CATCH is too long.
     
    eps, thedesolatesoul and lemonisdead like this.
  4. Sanjaya

    Sanjaya Member Licensed User

    Thank you LEMONISDEAD and NJDUDE for the pointers

    Going to try breaking up the code

    But this message never appeared before moving the Hard Drive onto a new Computer

    Hmmm
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    This error usually happens in rapid debug mode when you have a very large sub. The Try / Catch block is added automatically so it might be a bit confusing.

    The solution is to break it to smaller subs.
     
    Beja likes this.
  6. Syd Wright

    Syd Wright Active Member Licensed User

    The Try / Catch / Endtry is apparently hiddenly added by the Rapid Debugger and not visibly added to the B4A code.
    I wonder why that is necessary. It forces developers (like me) to re-write B4A code which normally executes fine in Release mode. If the developper does not find the need to add Try/Catch/Endtry's to a long sub, then why should the Debugger have to do this?!

    Both Debuggers still also do other things (in B4A V6.50) that causes the infamous "too many constants" error to occur while debugging a very large app.
     
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