Android Question error: code too large for try statement

msains

Member
Licensed User
Longtime User
Hi community, I seem to have generated a B4A compiler exception. Hopefully not !

I do have a very large project and up to now it has always compiled in both Debug and Release modes perfectly OK
All of a sudden it only compiles (no errors) in Release mode - but under Debug mode I now get ......

B4A Version: 8.00
Parsing code. (0.25s)
Compiling code. (0.44s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. (0.03s)
Compiling debugger engine code. Error
B4A line: 1975
End Sub
javac 1.8.0_172
shell\src\OwlIT\OwlRover\machine_subs_0.java:6323: error: code too large for try statement
catch (Exception e) {
^
1 error

Have I perhaps reached some size limit of the compiler or have I (hopefully) missed something trivial and just can't see it ??
 

Johan Schoeman

Expert
Licensed User
Longtime User
Hi community, I seem to have generated a B4A compiler exception. Hopefully not !

I do have a very large project and up to now it has always compiled in both Debug and Release modes perfectly OK
All of a sudden it only compiles (no errors) in Release mode - but under Debug mode I now get ......

B4A Version: 8.00
Parsing code. (0.25s)
Compiling code. (0.44s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. (0.03s)
Compiling debugger engine code. Error
B4A line: 1975
End Sub
javac 1.8.0_172
shell\src\OwlIT\OwlRover\machine_subs_0.java:6323: error: code too large for try statement
catch (Exception e) {
^
1 error

Have I perhaps reached some size limit of the compiler or have I (hopefully) missed something trivial and just can't see it ??
See Erel' answer here.

https://www.b4x.com/android/forum/t...e93-ean8-ean13-and-code128.57248/#post-363837
 
Upvote 0

msains

Member
Licensed User
Longtime User
Thanks Johan, I should have searched first. That post from Erel is perfectly correct. In case others get the problem (and take the trouble to search .. lol) - it seems to me that the size restriction is a 'Per Sub' one so the fairly easy solution is to cut the 'Big' sub into several smaller ones. You might have to pass state to the smaller subs via careful use of Global variables or even through the Sub's parameters. I chose to be careful with Globals and its working perfectly again without over-straining the compiler anymore.
 
Upvote 0
Top