Closed MrWeezle closed 11 months ago
Hi @MrWeezle
I merged PR without any modification and the last PR commit is:
- import androidx.LocalBroadcastManager;
+ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
This is mostly a capacitor issue and you need further investigations on it. When I'll have a time-slot give I try to figure out the problem
Thanks for the reply. I looked at the commits in the wrong order, my bad.
But the solution is changing the implementation lines in the gradle file.
add
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0"
and remove
implementation "com.android.support:support-v4:26+"
At least that's what solved the issue for me for building with Android Studio but not with Jenkins because even though I added the gradle to git the change is overridden to the default when using npx cap sync
I found a solution that works for me:
In the plugin.xml file in the section for android I changed
<framework src="com.android.support:support-v4:26+" />
to
<framework src="androidx.localbroadcastmanager:localbroadcastmanager:1.0.0" />
The Build process updates the gradle file correctly and no errors are shown. For validation with a Jenkins Build I forked this project, implemented the change, used the forked project in package.json and ran a build. No errors.
I cannot confirm that changing the used library in the framework part works for every use case, but it works for our app.
HI @MrWeezle
I think that your update to plugin.xml
is the right way to deploy broadcaster plugin
I'll arrange a new release with your fix
hi @bsorrentino
Thank you very much for the fast response.
fixed in release 5.1.0
I upgraded my Ionic App to Capacitor 5 and also updated all plugins to the newest compatible version. I also updated this plugin (cordova-broadcaster) to version 5.0.0 where I saw that a fix for androidx was implemented. Sadly, the build still fails with the following error message:
Manually editing the gradle file to add
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0"
and removingimplementation "com.android.support:support-v4:26+"
because it is not compatible, results in a working Build in Android Studio and a functioning broadcaster. Leaving the support-library in results in following error messages, thus i removed it:But building it with Jenkins always fails, because the gradle file is overridden with capacitor sync.
The import in CSVBroadcaster.java is
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
which is different from the value I saw in the PR a few days ago.Is there any solution to get a working build with Jenkins?