D davemorris Active Member Licensed User Longtime User Apr 9, 2020 #1 Hi, Guys I am having a purge and decided to address all the Compiler warnings for my App. But I am left with Library 'FirebaseAnalytics' is not used. (warning #32) My App uses Push notifications, so I assume this library is required (but the code will compile without it - not sure if it runs correctly as the GPS is rarely used and difficult to test). Obviously, within the code I have used the following to remove warnings - usually left in for future work Code: Copy Dim unusedVariable as int 'Ignore - i.e. leave maybe used later! Question: how do we remove these library warnings? Kind regards Dave
Hi, Guys I am having a purge and decided to address all the Compiler warnings for my App. But I am left with Library 'FirebaseAnalytics' is not used. (warning #32) My App uses Push notifications, so I assume this library is required (but the code will compile without it - not sure if it runs correctly as the GPS is rarely used and difficult to test). Obviously, within the code I have used the following to remove warnings - usually left in for future work Code: Copy Dim unusedVariable as int 'Ignore - i.e. leave maybe used later! Question: how do we remove these library warnings? Kind regards Dave
DonManfred Expert Licensed User Longtime User Apr 9, 2020 #2 davemorris said: Question: how do we remove these library warnings? Click to expand... B4X: Copy #IgnoreWarnings: 1,2,3 'replace with the correct values. B4X: Copy Upvote 0
davemorris said: Question: how do we remove these library warnings? Click to expand... B4X: Copy #IgnoreWarnings: 1,2,3 'replace with the correct values. B4X: Copy
D davemorris Active Member Licensed User Longtime User Apr 10, 2020 #3 Hi Donfred Thanks for the input, but using #IgnoreWarning will not provide a satisfactory result i.e. Code: Copy #IgnoreWarning 32 ' As it will remove ALL un-used library compiler warnings. I found a workaround by including this code somewhere in the project. Code: Copy Sub Class_Global Private fa as FirebaseAnalytics '| 'More code as required. End Sub Public Sub Initialize fa.Initialize ' Inserted to remove compiler warning. '| 'More code as required. End Sub I am not great on how B4A works under the hood, but my C# experience says this just creates a new instance of FirebaseAnalytics (only if the class is used) and the garbage collector will remove it when the instance goes out of scope. So I don't see any harm, please advise of otherwise - or obviously if someone has a more elegant solution. Kind regards Dave Upvote 0
Hi Donfred Thanks for the input, but using #IgnoreWarning will not provide a satisfactory result i.e. Code: Copy #IgnoreWarning 32 ' As it will remove ALL un-used library compiler warnings. I found a workaround by including this code somewhere in the project. Code: Copy Sub Class_Global Private fa as FirebaseAnalytics '| 'More code as required. End Sub Public Sub Initialize fa.Initialize ' Inserted to remove compiler warning. '| 'More code as required. End Sub I am not great on how B4A works under the hood, but my C# experience says this just creates a new instance of FirebaseAnalytics (only if the class is used) and the garbage collector will remove it when the instance goes out of scope. So I don't see any harm, please advise of otherwise - or obviously if someone has a more elegant solution. Kind regards Dave
agraham Expert Licensed User Longtime User Apr 10, 2020 #4 Probably better. If you put it in Globals it won't go out of scope and be garbage collected - it will as a local variable. B4X: Copy Public Sub Initialize Private fa as FirebaseAnalytic fa.Initialize ' Inserted to remove compiler warning. '| 'More code as required. End Sub Upvote 0
Probably better. If you put it in Globals it won't go out of scope and be garbage collected - it will as a local variable. B4X: Copy Public Sub Initialize Private fa as FirebaseAnalytic fa.Initialize ' Inserted to remove compiler warning. '| 'More code as required. End Sub