title: Android Studio and Gradle dependency integration
body: <p>I'm following <a href="http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html">this tutorial</a> but with Android Studio. I have done the following steps:</p>
  
  <p>Creating a new project in Android Studio</p>
  
  <p>Adding the OpenCV-2.4.5-sdk/sdk/java as a module</p>
  
  <p>Right clicked on my main module->Change Module settings-> added the above opencv module as a dependency</p>
  
  <p>For my MainActivity I used the following code (stripped down from one of the samples):</p>
  
  <pre><code>package com.example.test;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.util.Log;
  import android.view.Menu;
  import org.opencv.android.BaseLoaderCallback;
  import org.opencv.android.CameraBridgeViewBase;
  import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener;
  import org.opencv.android.LoaderCallbackInterface;
  import org.opencv.android.OpenCVLoader;
  import org.opencv.core.Mat;
  
  public class MainActivity extends Activity implements CvCameraViewListener {
      private CameraBridgeViewBase mOpenCvCameraView;
  
      private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
          @Override
          public void onManagerConnected(int status) {
              switch (status) {
                  case LoaderCallbackInterface.SUCCESS:
                  {
                      Log.i("Yay", "OpenCV loaded successfully");
                      mOpenCvCameraView.enableView();
                  } break;
                  default:
                  {
                      super.onManagerConnected(status);
                  } break;
              }
          }
      };
  
      @Override
      public void onResume()
      {
          super.onResume();
          OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5, this, mLoaderCallback);
      }
  
      @Override
      public void onCameraViewStarted(int width, int height) {
  
      }
  
      @Override
      public void onCameraViewStopped() {
  
      }
  
      @Override
      public Mat onCameraFrame(Mat inputFrame) {
          return null;
      }
  }
  </code></pre>
  
  <p>Android Studio's text editor could identify the packages I have imported (like org.opencv.android) but when I compiled I got these errors:</p>
  
  <pre><code>Gradle: error: package org.opencv.android does not exist
  Gradle: error: package org.opencv.android does not exist
  Gradle: error: package org.opencv.android.CameraBridgeViewBase does not exist
  </code></pre>
  
  <p>Does anyone know why this happens?</p>