Android - Opencv - error: (-215) u != 0 in function void cv::Mat::create
<p>My app keeps crashing with this error </p>

<pre><code>FATAL EXCEPTION: Thread-22883
    Process: com.aar.Cline, PID: 7270
    CvException [org.opencv.core.CvException: cv::Exception: /Volumes/Linux/builds/master_pack-android/opencv/modules/core/src/matrix.cpp:424: error: (-215) u != 0 in function void cv::Mat::create(int, const int*, int)
    ]
    at org.opencv.imgproc.Imgproc.cvtColor_1(Native Method)
    at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:1724)
    at com.aar.Cline.TrackBallActivity.detectBall(TrackBallActivity.java:592)
    at com.aar.Cline.TrackBallActivity.onCameraFrame(TrackBallActivity.java:190)
    at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:391)
    at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:350)
    at java.lang.Thread.run(Thread.java:818)
</code></pre>

<p>The app is running fine for about 3 min when suddenly in the middle this error shows up here is the line on which it keeps crashing</p>

<pre><code>Mat grayImage1 = new Mat();
Imgproc.cvtColor(frame1, grayImage1, Imgproc.COLOR_BGR2GRAY);
</code></pre>

<p>Any suggestions?</p>