Android Tutorial Compiler Warnings

Starting from v2.70, Basic4android includes a warning engine. The purpose of the warning engine is to find potential programming mistakes as soon as possible.

The warning engine runs whenever you compile the project, when clicking on Project -> Test Compilation or when you save the project.

The compile time warnings appear above the logs and in the code itself:



Clicking on the warning will take you to the relevant code.

Ignoring warnings

You, as the developer, can choose to ignore any warning. Adding an "ignore" comment will remove all the warnings for that specific line:
B4X:
Sub UnusedSub(a As Int) 'ignore

You can also disable warning from a specific type in the module by adding the #IgnoreWarning attribute.
For example to disable warnings #10 and #12:
B4X:
#IgnoreWarnings: 10, 12

Runtime warnings

Some of the warnings are only checked at runtime. These warnings will appear in the regular logs.
Runtime warnings are only checked in Debug mode.

List of warnings

 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…