MobisysGmbH / cordova-plugin-mlkit-barcode-scanner

A Cordova barcode scanning plugin based on the Google Mobile Vision library for iOS & Android.
MIT License
19 stars 22 forks source link

error: cannot find symbol mCameraView.setPreferredImplementationMode(PreviewView.ImplementationMode.TEXTURE_VIEW); #12

Open violuke opened 2 years ago

violuke commented 2 years ago

I'm getting this error when trying to build my app with this plugin. Can you please help?

> Task :app:compileReleaseJavaWithJavac FAILED
/workspace/build/cordova/platforms/android/app/src/main/java/com/mobisys/cordova/plugins/mlkit/barcode/scanner/CaptureActivity.java:260: error: cannot find symbol
    mCameraView.setPreferredImplementationMode(PreviewView.ImplementationMode.TEXTURE_VIEW);
                                                                             ^
  symbol:   variable TEXTURE_VIEW
  location: class ImplementationMode
/workspace/build/cordova/platforms/android/app/src/main/java/com/mobisys/cordova/plugins/mlkit/barcode/scanner/CaptureActivity.java:306: error: cannot find symbol
    preview.setSurfaceProvider(mCameraView.createSurfaceProvider());
                                          ^
  symbol:   method createSurfaceProvider()
  location: variable mCameraView of type PreviewView
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /workspace/build/cordova/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
JohnOhl commented 2 years ago

You may need to check to ensure the cordova-plugin-androidx-adapter package is also installed, and if you're using cordova-android < 9.0.0 the cordova-plugin-androidx package needs to be installed as well.