Can't add LocalBroadcastManager to project in Android Studio

瘦欲@ 提交于 2019-12-06 06:01:51

Make sure your library got added successfully.

Check the following things.

1.Your build.gradle should be like

   dependencies {
          compile 'com.android.support:support-v4:19.0.+'
   }

2.File > Project Structure > Modules >Dependency Tab There should not be any red mark in dialog showing error if they are fix them.

3.Check your Module_Name.iml file

It should have this entry in last section

<orderEntry type="library" exported="" name="support-v4-19.0.0" level="project"/>

If its there with no entry close you studio delete .iml file and open studio again wait for gradle sync to be complete.You .iml file will be created again check for entry.

If every thing is fine do sync Your project with gradle again using this lovely tiny gradle button in toolbar.

Try adding this dependency to your app level build.gradle :

implementation 'com.android.support:localbroadcastmanager:28.0.0'

Then sync project with Gradle files.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!