AndroidRuntime: FATAL EXCEPTION: main : application has stopped error
<p>I get the error Fatal Exception main whenever I run application .
the app uses opencv 2.4.10 it has worked on one device and it fails on my device I couldn't figure out why this is happening.</p>

<p>I don't know which part is code is causing this error : </p>

<pre><code>09-13 10:55:30.039 19555-19555/org.blatnik.eyemon E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.blatnik.eyemon, PID: 19555
java.lang.RuntimeException: Unable to start service org.blatnik.eyemon.MainService@66d5693 with Intent { flg=0x10000000 cmp=org.blatnik.eyemon/.MainService }: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4079)
    at android.app.ActivityThread.access$2400(ActivityThread.java:221)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1897)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7224)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
 Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
    at android.view.ViewRootImpl.setView(ViewRootImpl.java:853)
    at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:337)
    at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
    at android.app.Dialog.show(Dialog.java:350)
    at **org.opencv.android.BaseLoaderCallback.onPackageInstall(BaseLoaderCallback.java:110)
    at org.opencv.android.AsyncServiceHelper.InstallService(AsyncServiceHelper.java:117)
    at org.opencv.android.AsyncServiceHelper.initOpenCV(AsyncServiceHelper.java:33)
    at org.opencv.android.OpenCVLoader.initAsync(OpenCVLoader.java:85)
    at org.blatnik.eyemon.MainService.onStartCommand(MainService.java:140)**
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4062)
    at android.app.ActivityThread.access$2400(ActivityThread.java:221) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1897) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:158) 
    at android.app.ActivityThread.main(ActivityThread.java:7224) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
</code></pre>

<p> </p>

<p>please any solution would be very thankful. </p>