In my app, I'm calling registerBroadcastReceiver (which works fine). However, I'm getting the following stack trace when closing the app (by swiping it away from the recent apps list).
com.example.app E/ActivityThread: Activity com.example.app.MainActivity has leaked IntentReceiver com.darryncampbell.cordova.plugin.intent.IntentShim$1@66e15a5 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Activity com.example.app.MainActivity has leaked IntentReceiver com.darryncampbell.cordova.plugin.intent.IntentShim$1@66e15a5 that was originally registered here. Are you missing a call to unregisterReceiver()?
at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:1538)
at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:1277)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1555)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1528)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1516)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:636)
at com.darryncampbell.cordova.plugin.intent.IntentShim.execute(IntentShim.java:172)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:326)
at android.os.Looper.loop(Looper.java:181)
at android.os.HandlerThread.run(HandlerThread.java:65)
I noticed that the plugin does not have an onDestroy method. I am able to get rid of the above log by adding the following to IntentShim.java
In my app, I'm calling
registerBroadcastReceiver
(which works fine). However, I'm getting the following stack trace when closing the app (by swiping it away from the recent apps list).I noticed that the plugin does not have an
onDestroy
method. I am able to get rid of the above log by adding the following to IntentShim.java