Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error at build time because of plugin #251

Closed
Anurag-Sing opened this issue Nov 15, 2017 · 1 comment
Closed

Getting error at build time because of plugin #251

Anurag-Sing opened this issue Nov 15, 2017 · 1 comment

Comments

@Anurag-Sing
Copy link

Hi at the time of build i am getting the following error

cordova\plugins\Diagnostic.java:378: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing this.cordova.getActivity() to this.cordova.getActivity().getApplicationContext() [WifiManagerLeak]
WifiManager wifiManager = (WifiManager) this.cordova.getActivity().getSystemService(Context.WIFI_SERVICE);

and

Diagnostic.java:451: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing this.cordova.getActivity() to this.cordova.getActivity().getApplicationContext() [WifiManagerLeak]
WifiManager wifiManager = (WifiManager) this.cordova.getActivity().getSystemService(Context.WIFI_SERVICE);

my plugin version is cordova.plugins.diagnostic 3.1.7 "Diagnostic"

please reply ASAP

@hugomenesesp
Copy link

As a fast workaround, you can downgrade your Android Platform to <6.4

cordova platform rm android
cordova platform add [email protected] 

Full answer explanation here: https://stackoverflow.com/a/47319534/1583507

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants