rleiman Well-Known Member Licensed User Longtime User Mar 12, 2021 #1 Greetings, After setting up B4A on a new computer, I made a small test app which I compiled tested. It compile and ran ok. I tried to compile one of my working apps from Google Play and got this try/catch error. The sub routine in the error doesn't have any Try/Catch statements in it. What is it and how can I fix it so it will compile? Is my installation not set correctly? Thanks. Attachments Screenshot 2021-03-11 at 21.42.07.png 375.9 KB · Views: 522 Last edited: Mar 12, 2021
Greetings, After setting up B4A on a new computer, I made a small test app which I compiled tested. It compile and ran ok. I tried to compile one of my working apps from Google Play and got this try/catch error. The sub routine in the error doesn't have any Try/Catch statements in it. What is it and how can I fix it so it will compile? Is my installation not set correctly? Thanks.
Erel B4X founder Staff member Licensed User Longtime User Mar 12, 2021 #2 This error happens when the sub is too large and the Java compiler hits a limit. Split the sub into multiple subs. Upvote 0
This error happens when the sub is too large and the Java compiler hits a limit. Split the sub into multiple subs.
rleiman Well-Known Member Licensed User Longtime User Mar 12, 2021 #3 Erel said: This error happens when the sub is too large and the Java compiler hits a limit. Split the sub into multiple subs. Click to expand... Thanks for the reply. I will split it in half and see if it compiles. Is this a new limit set by the current version of B4A or can I set the limit to a larger number? I ask because this is an app that's already on Google Play and I was able to compile it without the error in the previous version of B4A. Upvote 0
Erel said: This error happens when the sub is too large and the Java compiler hits a limit. Split the sub into multiple subs. Click to expand... Thanks for the reply. I will split it in half and see if it compiles. Is this a new limit set by the current version of B4A or can I set the limit to a larger number? I ask because this is an app that's already on Google Play and I was able to compile it without the error in the previous version of B4A.
KMatle Expert Licensed User Longtime User Mar 12, 2021 #4 I don't think so. BTW: Never try to catch huge code blocks (doesn't make sense as you assume that e.g. 500 lines of code are not working correctly). Use it only when it is really needed. If your app crashes, just check the problem (even if it's in production). Upvote 0
I don't think so. BTW: Never try to catch huge code blocks (doesn't make sense as you assume that e.g. 500 lines of code are not working correctly). Use it only when it is really needed. If your app crashes, just check the problem (even if it's in production).
rleiman Well-Known Member Licensed User Longtime User Mar 12, 2021 #5 I can't believe I didn't notice it, but when you install a new copy of B4A they put it in Debug mode. When I changed it back to Release mode, it compiled like before without any errors or warnings. Because of my stupidity for not paying attention, I'm marking this thread as solved for any newbies installing B4A for the first time. Anyway, I'm glad I still got useful tips from everyone. Upvote 0
I can't believe I didn't notice it, but when you install a new copy of B4A they put it in Debug mode. When I changed it back to Release mode, it compiled like before without any errors or warnings. Because of my stupidity for not paying attention, I'm marking this thread as solved for any newbies installing B4A for the first time. Anyway, I'm glad I still got useful tips from everyone.
agraham Expert Licensed User Longtime User Mar 12, 2021 #6 rleiman said: but when you install a new copy of B4A they put it in Debug mode Click to expand... This happens because Debug mode adds extra code to your Subs. However it would seem that you have too much code in that Sub. Good programming practice is to have many smaller Subs rather than one big one! It makes understanding and debugging the code easier. Upvote 0
rleiman said: but when you install a new copy of B4A they put it in Debug mode Click to expand... This happens because Debug mode adds extra code to your Subs. However it would seem that you have too much code in that Sub. Good programming practice is to have many smaller Subs rather than one big one! It makes understanding and debugging the code easier.
rleiman Well-Known Member Licensed User Longtime User Mar 12, 2021 #7 agraham said: This happens because Debug mode adds extra code to your Subs. However it would seem that you have too much code in that Sub. Good programming practice is to have many smaller Subs rather than one big one! It makes understanding and debugging the code easier. Click to expand... Thanks for the useful tip. Upvote 0
agraham said: This happens because Debug mode adds extra code to your Subs. However it would seem that you have too much code in that Sub. Good programming practice is to have many smaller Subs rather than one big one! It makes understanding and debugging the code easier. Click to expand... Thanks for the useful tip.