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

Connectivity Plugin crashes a Foreground Service without activities in the background #50

Closed
ertay opened this issue Mar 31, 2015 · 3 comments

Comments

@ertay
Copy link

ertay commented Mar 31, 2015

Hey James,

You can find a demo solution here: http://1drv.ms/1xvg1lq

Steps to reproduce:

  1. Launch app.
  2. Open recent apps list
  3. Swipe the app to left/right to kill the activity
  4. Foreground Service should be running still (notification should still be visible in the notification center).
  5. Now turn on or off WiFi (it must connect to an access point)

At this point the service should crash without giving any errors. Debugger should also detach immediately without anything on the output window.

Weird thing is, if the UI isn't killed (if you skip step 3 above) the service does not crash.

You will notice that no code is used in the solution from the Connectivity plugin. It only has to be installed in the project(s). Uninstalling the plugin from the projects fixes the issue.

Cheers,
Ertay

@jamesmontemagno
Copy link
Owner

Please check out package 1.0.2 now on GitHub.

I do believe that there are some potential crashers in your code when try to get the Activity from MVVMCross. Instead of using the .Activity simply use the ApplicationContext to create your intents. I would be concerned about MVVMCross having to be Init again in service as well so be aware of that too.

@ertay
Copy link
Author

ertay commented Mar 31, 2015

Hmmm, the steps I listed above don't say that you need to open the activity. (or maybe you were talking in general and not related to the Connectivity crash). But my app works fine once I removed the old connectivity plugin (will try 1.0.2 ).

@jamesmontemagno
Copy link
Owner

It was an issue with the broadcast receiver that I had implemented. I simply register and unregister in the implementation.

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