rodgomesc / vision-camera-face-detector

VisionCamera Frame Processor Plugin to detect faces using MLKit Vision Face Detector
MIT License
89 stars 65 forks source link

Android build failed in Mac Mini M1 #6

Closed r0b0t3d closed 2 years ago

r0b0t3d commented 2 years ago

Issue

I can build my project normally in macbook pro late 2014. But in Mac mini M1, I got this error

/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:29: error: package com.mrousavy.camera.frameprocessor does not exist
import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin;
                                         ^
/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:35: error: cannot find symbol
public class VisionCameraFaceDetectorPlugin extends FrameProcessorPlugin {
                                                    ^
  symbol: class FrameProcessorPlugin
/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPluginPackage.java:10: error: package com.mrousavy.camera.frameprocessor does not exist
import com.mrousavy.camera.frameprocessor.FrameProcessorPlugin;
                                         ^
/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPlugin.java:134: error: method does not override or implement a method from a supertype
  @Override
  ^
/node_modules/vision-camera-face-detector/android/src/main/java/com/visioncamerafacedetector/VisionCameraFaceDetectorPluginPackage.java:19: error: cannot find symbol
    FrameProcessorPlugin.register(new VisionCameraFaceDetectorPlugin());
    ^
  symbol:   variable FrameProcessorPlugin
  location: class VisionCameraFaceDetectorPluginPackage
5 errors

Enviroment

r0b0t3d commented 2 years ago

This is actually not related to this lib. The issue is that ndk haven't support M1 yet. I need to change ndk-build to use Rosetta x86

DIR="$(cd "$(dirname "$0")" && pwd)"
arch -x86_64 /bin/bash $DIR/build/ndk-build "$@"

Details here: https://stackoverflow.com/a/69555276/8268484