title: How to fix following error when using Android Image Cropper library: Cannot resolve symbol 'OnGetCroppedImageCompleteListener'
body: <p>I have an activity that uses Android Image Cropper library for cropping. I keeping getting this error Cannot resolve symbol 'OnGetCroppedImageCompleteListener' which I spent days trying to solve without any success. </p>
  
  <p>Here is the MainActivity.java where the error is occurring:</p>
  
  <pre><code>import android.Manifest;
  import android.app.Activity;
  import android.content.Intent;
  import android.content.pm.PackageManager;
  import android.graphics.Bitmap;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.util.Log;
  import android.view.View;
  import android.widget.TextView;
  import android.widget.Toast;
  
  import com.theartofdev.edmodo.cropper.CropImage;
  import com.theartofdev.edmodo.cropper.CropImageView;
  
  public class  MainActivity extends AppCompatActivity implements  CropImageView.OnGetCroppedImageCompleteListener,  CropImageView.OnSetImageUriCompleteListener {
  
      private CropImageView mCropImageView;
  
      private View mProgressView;
  
      private Uri mCropImageUri;
  
      private TextView mProgressViewText;
  
      @Override
      protected void onCreate(Bundle  savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          mCropImageView = (CropImageView)  findViewById(R.id.CropImageView);
          mProgressView =  findViewById(R.id.ProgressView);
          mProgressViewText = (TextView)  findViewById(R.id.ProgressViewText);
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          mCropImageView.setOnSetImageUriCompleteListener(this);
          mCropImageView.setOnGetCroppedImageCompleteListener(this);
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          mCropImageView.setOnSetImageUriCompleteListener(null);
          mCropImageView.setOnGetCroppedImageCompleteListener(null);
      }
  
      public void onLoadImageClick(View view) {
          CropImage.startPickImageActivity(this);
      }
  
      public void onCropImageClick(View view) {
          mCropImageView.getCroppedImageAsync(mCropImageView.getCropShape(), 500,  500);
          mProgressViewText.setText("Cropping...");
          mProgressView.setVisibility(View.VISIBLE);
  
      }
  
      @Override
      public void  onSetImageUriComplete(CropImageView cropImageView, Uri uri, Exception error) {
          mProgressView.setVisibility(View.INVISIBLE);
          if (error != null) {
              Log.e("Crop",  "Failed to load image for cropping", error);
              Toast.makeText(this,  "Something went wrong, try again", Toast.LENGTH_LONG).show();
          }
      }
  
      @Override
      public void  onGetCroppedImageComplete(CropImageView view, Bitmap bitmap, Exception error) {
          mProgressView.setVisibility(View.INVISIBLE);
          if (error == null) {
              if (bitmap != null) {
                  mCropImageView.setImageBitmap(bitmap);
              }
          } else {
              Log.e("Crop",  "Failed to crop image", error);
              Toast.makeText(this,  "Something went wrong, try again", Toast.LENGTH_LONG).show();
          }
      }
  
      @Override
      protected void onActivityResult(int  requestCode, int resultCode, Intent data) {
          if (resultCode == Activity.RESULT_OK) {
              Uri imageUri = CropImage.getPickImageResultUri(this, data);
  
              // For API &gt;= 23 we need to check specifically that we have permissions to read external storage,
              // but we don't know if we need to for the URI so the simplest is to try open the stream and see if we get error.
              boolean requirePermissions = false;
              if (CropImage.isReadExternalStoragePermissionsRequired(this, imageUri)) {
  
                  // request permissions and handle the result in onRequestPermissionsResult()
                  requirePermissions = true;
                  mCropImageUri = imageUri;
                  requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 0);
              }
  
              if (!requirePermissions) {
                  mCropImageView.setImageUriAsync(imageUri);
                  mProgressViewText.setText("Loading...");
                  mProgressView.setVisibility(View.VISIBLE);
              }
          }
      }
  
      @Override
      public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
          if (mCropImageUri != null &amp;&amp; grantResults.length &gt; 0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
              mCropImageView.setImageUriAsync(mCropImageUri);
              mProgressViewText.setText("Loading...");
              mProgressView.setVisibility(View.VISIBLE);
          } else {
              Toast.makeText(this, "Required permissions are not granted", Toast.LENGTH_LONG).show();
          }
      }
  }
  </code></pre>
  
  <p>I just added the build.gradle file for additional information:</p>
  
  <pre><code>    apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 26
      buildToolsVersion "26.0.2"
      defaultConfig {
          applicationId "com.paigger.imagecroppercutomui"
          minSdkVersion 23
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })
      compile 'com.android.support:appcompat-v7:26.+'
      compile 'com.android.support.constraint:constraint-layout:1.0.2'
      compile 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
      testCompile 'junit:junit:4.12'
  }
  </code></pre>