bsorrentino / cordova-broadcaster

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

package android.support.v4.content does not exist #51

Closed kaanerdogan closed 3 years ago

kaanerdogan commented 4 years ago

Hi. Error in title just one of few. Getting these errors in ionic app. Didn't do anything but starting project and installing this plugin. I used plugin as mentioned in ionic docs Can't use this plugin as your readme anyway. When i try to use an error says expected 1 argument but got 2.

Some of other errors:

error: cannot find symbol
    LocalBroadcastManager.getInstance(super.webView.getContext()).unregisterReceiver(receiverHolder.receiver);
    ^
  symbol:   variable LocalBroadcastManager
error: cannot find symbol
    return LocalBroadcastManager.getInstance(super.webView.getContext()).sendBroadcast(intent);
           ^
  symbol:   variable LocalBroadcastManager
  location: class CDVBroadcaster

Btw i can build kotlin version of my app with the same intent. Which is airplane mode. So i am guessing the problem isn't with my java/gradle ... versions or anything with my computer.

bsorrentino commented 4 years ago

hi @kaanerdogan thank for feedback

Let me check to understand the problem.

Which version are you using ?

bsorrentino commented 4 years ago

hi @kaanerdogan

I use the sample project ionic-broadcaster-sample and it currently works

Could you let me know the differences that you have with it, in particular the different Cordova and Ionic distribution that you are using?

thanks in advance

kaanerdogan commented 4 years ago

Hi @bsorrentino,

I created the app with Ionic CLI version 6.x.x. I updated CLI to 6.9.1 yesterday. Tried to build again but didn't work. When i look at the platforms/android folder i see 2 different version of gradle. 4.10.3 and 6.3 . I'm guessing i downloaded the first one (4.10.3). Second one downloaded from Android Studio when i started a Kotlin project. Also Can't find which version of gradle used for build. My cordova version is 9.0.0.

Not all errors about your plugin btw. Some of them belongs to Ionic. It says can't find something in

ionicframework/cordova/webview/IonicWebViewEngine.java

and lot of errors about same folder. Actually even same file. Just different lines.

bsorrentino commented 4 years ago

Hi @kaanerdogan

I'll branch the sample project to try your configuration and let you know

kaanerdogan commented 4 years ago

@bsorrentino,

Is there any chance on improvement ? :)

bsorrentino commented 4 years ago

Hi @kaanerdogan

I've tested the plugin upgrading the infrastructure and it works well.

take a look at branch issue#7