dtarnawsky / nexus-browser

3 stars 3 forks source link

@capacitor-mlkit/barcode-scanning Error: Attempt to invoke virtual method on a null object reference #21

Open titobrasolin-ke opened 8 months ago

titobrasolin-ke commented 8 months ago

@dtarnawsky Thanks so much for the helpful addition 1a8f30a18ede1379602b5b7e438fb9a482ff35f7 Unfortunately I'm having some problems, here's how to reproduce it:

git clone https://github.com/robingenz/capacitor-mlkit-plugin-demo.git
cd capacitor-mlkit-plugin-demo
npm i
code .

Run on Web, open Nexus Browser and start scan. The result is as follows:

[error][capacitor] startScan failed.
[error][console] Error: Attempt to invoke virtual method 'void androidx.camera.view.PreviewView.setScaleType(androidx.camera.view.PreviewView$ScaleType)' on a null object reference

However, the The Google code scanner works correctly.

My development environment: Ubuntu 20.04.6 LTS, Visual Studio Code 1.86.0, Ionic official extension 1.69.0 My phone: moto g13, Android 13, Nexus Browser 1.17

dtarnawsky commented 8 months ago

Hey @titobrasolin-ke ,

The Nexus Browser app has only a certain list of plugins preinstalled in it. You can find them here: https://capacitor.nexusbrowser.com/capacitor

Unfortunately, the demo you are using contains plugins that Nexus Browser does not have preinstalled: capacitor-mlkit/barcode-scanning capacitor-mlkit/face-detection capacitor-mlkit/selfie-segmentation capacitor-mlkit/translation

So, in order to run the application in Nexus Browser we would also need to preinstall these plugins. So, I'll take this as a request to add these plugins and see if there are any problems (eg a conflict with another preinstalled plugin).

In the meantime however I would suggest running the application by building it in the usual way and running with cap run or Android Studio.

I'll keep the ticket open and let you know if those plugins can be added.

titobrasolin-ke commented 8 months ago

Hi @dtarnawsky , I thought @capacitor-mlkit/barcode-scanning had been added to Nexus Browser 1.17 https://github.com/ionic-team/vscode-ionic/issues/148