bsorrentino / cordova-broadcaster

Cordova Plugin to allow message exchange between javascript and native (and viceversa)
MIT License
113 stars 53 forks source link

probable android x support issue, app does not work after adding plugin, gradle error #68

Closed ghostzero192 closed 11 months ago

ghostzero192 commented 2 years ago

i have used this plugin with quasar 1 in the past, now i'm trying to do the same and i'm getting this error when i try to run the on the android device for development: `> Task :app:compileArm64DebugJavaWithJavac FAILED /home/zero/Documents/node/qv1app/src-cordova/platforms/android/app/src/main/java/org/bsc/cordova/CDVBroadcaster.java:8: error: package android.support.v4.content does not exist import android.support.v4.content.LocalBroadcastManager; ^ /home/zero/Documents/node/qv1app/src-cordova/platforms/android/app/src/main/java/org/bsc/cordova/CDVBroadcaster.java:163: error: cannot find symbol LocalBroadcastManager.getInstance(super.webView.getContext()).registerReceiver(receiver, filter); ^ symbol: variable LocalBroadcastManager location: class org.bsc.cordova.CDVBroadcaster /home/zero/Documents/node/qv1app/src-cordova/platforms/android/app/src/main/java/org/bsc/cordova/CDVBroadcaster.java:176: error: cannot find symbol LocalBroadcastManager.getInstance(super.webView.getContext()).unregisterReceiver(receiverHolder.receiver); ^ symbol: variable LocalBroadcastManager location: class org.bsc.cordova.CDVBroadcaster /home/zero/Documents/node/qv1app/src-cordova/platforms/android/app/src/main/java/org/bsc/cordova/CDVBroadcaster.java:192: error: cannot find symbol return LocalBroadcastManager.getInstance(super.webView.getContext()).sendBroadcast(intent); ^ symbol: variable LocalBroadcastManager location: class org.bsc.cordova.CDVBroadcaster Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 4 errors

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 5s 94 actionable tasks: 33 executed, 61 up-to-date Command failed with exit code 1: /home/zero/Documents/node/qv1app/src-cordova/platforms/android/gradlew cdvBuildDebug -b /home/zero/Documents/node/qv1app/src-cordova/platforms/android/build.gradle`

after some investigation i think that this may be related to lack of android x support, and it is suggested to set android.useAndroidX=true android.enableJetifier=true but this is already enabled in my project and i'm stille getting the same error

bsorrentino commented 2 years ago

hi @ghostzero192

Thanks for valuable feedback. Currently I'm not much active on such project, beyond your issue the project would need an upgrade of all its components i'll try to spend effort on that but i can't plan when

ghostzero192 commented 2 years ago

@bsorrentino thank you for your answer and for this awesome project, this plugin and 'com-darryncampbell-cordova-plugin-intent' are the only ones that i have been able to find, apparently not many people need this functionality in their apps which i find strange.

bsorrentino commented 2 years ago

@ghostzero192 probably they develop self-made solutions instead to use such plug-in. I developed it firstly to decouple native from web in a standard way.

However if you have time tests & PRs are always welcome