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

[Android] Remove unused layout xml file if feasible #664

Closed
ehsieh-semios opened this issue Jul 13, 2024 · 1 comment · Fixed by #670
Closed

[Android] Remove unused layout xml file if feasible #664

ehsieh-semios opened this issue Jul 13, 2024 · 1 comment · Fixed by #670
Labels
bug Something isn't working

Comments

@ehsieh-semios
Copy link

Describe the bug
A trivial Android layout xml bridge_layout_main.xml is conflicting with other plugins which have customized bridge_layout_main.xml

To Reproduce
Steps to reproduce the behavior:

  1. import another plugin. e.g: @capacitor-mlkit/barcode-scanning
  2. put [bluetooth-le](https://github.com/capacitor-community/bluetooth-le) prior to that plugin in capacitor.build.gradle:
dependencies {
    implementation project(':capacitor-community-bluetooth-le')
    implementation project(':capacitor-mlkit-barcode-scanning')
    ...

Expected behavior
The other modules like barcode-scanning should work successfully.

Screenshots
An error is shown:

21:21:55.769  E  Attempt to invoke virtual method 'void androidx.camera.view.PreviewView.setScaleType(androidx.camera.view.PreviewView$ScaleType)' on a null object reference
                 java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.camera.view.PreviewView.setScaleType(androidx.camera.view.PreviewView$ScaleType)' on a null object reference
                 	at io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.BarcodeScanner.lambda$startScan$0(BarcodeScanner.java:107)
                 	at io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.BarcodeScanner.$r8$lambda$XoJ4tltbmXkBZjUvzn_RkQLTSis(Unknown Source:0)
                 	at io.capawesome.capacitorjs.plugins.mlkit.barcodescanning.BarcodeScanner$$ExternalSyntheticLambda3.run(Unknown Source:8)
                 	at android.os.Handler.handleCallback(Handler.java:958)
                 	at android.os.Handler.dispatchMessage(Handler.java:99)
                 	at android.os.Looper.loopOnce(Looper.java:205)
                 	at android.os.Looper.loop(Looper.java:294)
                 	at android.app.ActivityThread.main(ActivityThread.java:8177)
                 	at java.lang.reflect.Method.invoke(Native Method)
                 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

Similar case here(conflicting between barcode-scanning and photoviewer ): googlesamples/mlkit#724

Plugin version:

  • @capacitor-community/bluetooth-le: 5.4.0

Smartphone (please complete the following information):

  • OS: Android

Additional context
Only one bridge_layout_main.xml(name conflicting) is left after packing, and it depends on the order in the gradle file.

@ehsieh-semios ehsieh-semios added the bug Something isn't working label Jul 13, 2024
@pwespi
Copy link
Member

pwespi commented Jul 22, 2024

Thanks for reporting. Fixed in 6.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants