Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(barcode-scanning): Black screen on Android device #42

Closed
4 of 7 tasks
vgrunner4v opened this issue May 31, 2023 · 7 comments
Closed
4 of 7 tasks

bug(barcode-scanning): Black screen on Android device #42

vgrunner4v opened this issue May 31, 2023 · 7 comments

Comments

@vgrunner4v
Copy link

vgrunner4v commented May 31, 2023

Plugin(s)

  • Barcode Scanning
  • Translation

Did you test the latest version?

  • I use the latest version

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

I followed the guide and tried to add it to my simple app. when i try to scan (after giving permissions), its showing black screen with the scanning square in the middle.

this is what i see on Samsung Galaxy A04e, just a black screen:

image

Expected behavior

Showing the camera preview and be able to scan barcodes.

Reproduction

https://github.com/robingenz/ionic-capacitor-barcode-scanner

Steps to reproduce

  1. clone the demo repo
  2. follow the installation guide in the README
  3. run on physical device through Android Studio
  4. open app, try to scan - black screen

Other information

Samsung Galaxy A04e with Android 13, running from android studio via Pair using WiFi

Capacitor doctor

PS J:\ionic-capacitor-barcode-scanner> npx cap doctor
[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted.                                        
    Capacitor Doctor
                                                                                                                                                                                                                                                 Latest Dependencies:

  @capacitor/cli: 5.0.4
  @capacitor/core: 5.0.4
  @capacitor/android: 5.0.4
  @capacitor/ios: 5.0.4

Installed Dependencies:

  @capacitor/core: 5.0.0
  @capacitor/ios: 5.0.0                                                                                                             
  @capacitor/android: 5.0.0
  @capacitor/cli: 5.0.0

[error] Missing <manifest package=""> attribute in app/src/main 

Before submitting

  • I understand that incomplete issues (e.g. without reproduction) are closed.
@vgrunner4v vgrunner4v added bug/fix Something isn't working needs: triage labels May 31, 2023
@vgrunner4v
Copy link
Author

vgrunner4v commented Jun 1, 2023

update: in this demo app: https://github.com/robingenz/capacitor-mlkit-plugin-demo

the Start Scan is working, but the Scan shows black screen like in the image above..

@robingenz
Copy link
Member

Seems like this is an issue with the com.google.android.gms:play-services-code-scanner dependency, see https://issuetracker.google.com/issues/285007312

I can't reproduce it on my Google Pixel. I recommend using the startScan(...) method until Google fixes the problem.

@vgrunner4v
Copy link
Author

@robingenz - to be able to use startScan(...) i need to create my own page / component, right? we do not use Ionic, just ReactJS (spa) with Capacitor.

@robingenz
Copy link
Member

Yes, to use the startScan(...) method, you need to build the UI yourself. You don't need to use Ionic for that - just basic HTML/CSS.

@vgrunner4v
Copy link
Author

Got it, thanks, seems like this is the workaound for now.

@robingenz robingenz changed the title bug: (barcode-scanning): Black screen on Android device bug(barcode-scanning): Black screen on Android device Jun 2, 2023
@robingenz
Copy link
Member

This issue might be related to #38

@robingenz
Copy link
Member

The issue can be resolved by updating Google Play Services to the latest version. If you continue to experience the same problem, you can try uninstalling and then reinstalling Google Play Services that's worked for me on my physical device and the emulator.

The issue was closed by Google. It seems like you can fix this by updating Google Play Services. For this reason i am closing this issue.

@robingenz robingenz closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants