I'm doing a face recognition android application with opencv. When i try to run the project i get "Error:(3, 18) error: cannot find symbol class R" error. How can i solve this?
I'm trying to do a face recognition application and for that i'm using opencv. I wanted to try out a sample first so i followed few of the samples that were available. I downloaded opencv4.0.1 and imported to my app in android studio -> Next changed the opencv gradle according to my gradle settings -> gradle files were synced succeessfully without errors -> Next as the tutorial stated i added the module dependency to my application where i selected the opencv module as the dependency. Synced my gradle files. All was synced successfully. I tried to run the application but the comes the error " Error:(3, 18) error: cannot find symbol class R" following "Error:(48, 78) error: package R does not exist".
This is one of the tutorials i followed as i'm completely new to opencv : https://www.learn2crack.com/2016/03/setup-opencv-sdk-android-studio.html
I already tried, cleaning & building the project again, invalidating and restarting the project, checking xml errors & etc. But none worked.
And this error is coming in some opencv files which i have mentioned below.
package org.opencv.android;
import org.opencv.R;
import android.content.Context;
import android.content.res.TypedArray;
import android.opengl.GLSurfaceView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
public class CameraGLSurfaceView extends GLSurfaceView {
private static final String LOGTAG = "CameraGLSurfaceView";
public interface CameraTextureListener {
/**
* This method is invoked when camera preview has started. After this method is invoked
* the frames will start to be delivered to client via the onCameraFrame() callback.
* @param width - the width of the frames that will be delivered
* @param height - the height of the frames that will be delivered
*/
public void onCameraViewStarted(int width, int height);
/**
* This method is invoked when camera preview has been stopped for some reason.
* No frames will be delivered via onCameraFrame() callback after this method is called.
*/
public void onCameraViewStopped();