I wanted to create an app via React-Native for pose detection by using ML Kit.
I used the instructions of the Google Ml Kit website and I used the following task:
poseDetector.process(image)
But when building, I get the error:
error: cannot access Detector
poseDetector.process(image)
^
class file for com.google.mlkit.vision.common.internal.Detector not found
I used several imports in the Java file, but apparently I get the same error over and over again but I don’t know why.
I can’t find anything to it. It seems nobody has the same problem. I thought maybe it’s an easy fix.
Imported several dependencies in build.gradle and libraries in the application.
For the application:
import android.graphics.PointF;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import androidx.annotation.NonNull;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Promise;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.mlkit.vision.common.InputImage;
import com.google.mlkit.vision.common.PointF3D;
import com.google.mlkit.vision.common.Triangle;
import com.google.mlkit.vision.pose.accurate.AccuratePoseDetectorOptions;
import com.google.mlkit.vision.interfaces.Detector;
import com.google.mlkit.vision.pose.Pose;
import com.google.mlkit.vision.pose.PoseDetector;
import com.google.mlkit.vision.pose.PoseDetection;
import com.google.mlkit.vision.pose.PoseDetectorOptionsBase;
import com.google.mlkit.vision.pose.PoseLandmark;
import com.google.mlkit.vision.pose.defaults.PoseDetectorOptions;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
I know a lot of them are unused, but that’s the result of desperation I guess…
SetchFrank is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.