Closed aekasitt closed 1 year ago
@aekasitt We already encountered this issue before and the issue was never related to the plugin itself. It usually happens after updating capacitor or ionic to a new version. Unfortunately, I am not really sure what can cause this issue other than some "wrong" capacitor configurations, dependencies, or whatever.
I had it once in my code and after "cleaning up" my node_modules and re-adding the Android project the issue was gone.
Without the possibility of looking at your complete project, I can't help you in this case. There are a few people online with the same problem with other plugins, maybe some of those solutions can point you in the right direction without sharing your project. If you are able to create a minimal setup to reproduce the issue I can have a look at it, but I was not able to do so as I had the issue previously.
Noted with thanks. You can also assume I had been testing "clean-ups" with the following setup permutations as well.
Node version
: [16, 18] (unable to use node v14 because vue-tsc
does not build)
Package manager
: [npm, yarn]
@ionic/core
& @ionic/vue
& @ionic/vue-router
: [6.7.3, 6.7.4, 7.0.3]
@capacitor/android
& @capacitor/cli
& @capacitor/core
: [4.1.1, 4.3.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0]
With no luck.
If you have any idea what is the culprit for the unexpected build behavior, whether it's using an aarch64
build environment, or including a cordova plugin, using latest @capacitor/ libs or latest @ionic/, it would be very helpful.
The more I look into it, the more I find that my android
build has none of the plugins defined in build steps.
Will pursue workaround recommended by Ionic Troubleshooting recommendations instead.
@aekasitt I think this is a good place to start with yes, I am pretty sure it has something to do with the Android setup. One thing came to my mind that helped me once I had this issue was to resync my android studio project with the gradle files. Maybe this might help in your case as well. Unfortunately I don't really have other suggestions.
If you can resolve your issue, it would be awesome if you could post a quick note here, it might really help if someone else runs into this problem in the future!
Thanks!
@thegnuu Not kidding, this has caused me much gripe in the past few days and narrowed down the culprit after hours in Logcat....
My template did not have <head></head>
tag.
Acknowledgements
Describe the bug Not at liberty to share the repo at the moment. The bug is the fact that BarcodeScanner plugin itself, not its functions, never get defined or attached to the built CapacitorJS app. I have followed through every step on the README and make sure to use the right version of lib and capacitor (see below).
To Reproduce I set my codebase to toast error message using
vue-toastification
So when I mount the vue component with the "BarcodeScanner" the modal pops up and begin scanning. Attached codebase below:Expected behavior To make sure this bug does not get dismissed for faulty process setup or ionic visibility, I make sure to get it working on web environment. (Chrome only, not Firefox) Attached is the expected behavior.
Screenshots
Version
@capacitor/core
: 4.8.0@capacitor/android
: 4.8.0@capacitor-community/barcode-scanner
: 3.0.3Desktop (please complete the following information):
macOS Ventura Version 13.0.1
Chrome
112.0.5615.137 (Official Build) (arm64)
Smartphone (please complete the following information):
OnePlus 7
(GM1900) andAndroid Emulator
on MacBook Pro M1 ("system-images;android-33;google_apis;arm64-v8a")HydrogenOS
(OP7) andStock Android
(Emulator)Android Version 11
(OP7) and N/AAndroid System WebView (112.0.5615.136)
Additional context Seems I may be redirected toward having multiple
package.json
file on my monorepo but I can assure that is not the case. Attached is the outputs of thenpx cap sync
process.