Android Library project can't import R class of another library project when using gradle to compile on command line

萝らか妹 提交于 2019-12-03 15:38:11

Hello I had same problem, my android library project, uses another library (actionBarSherlock). It can't resolve import com.actionbarsherlock.R; when I changed the line in gradle.build: apply plugin: 'android-library' to: apply plugin: 'android' then it goes well.

But I needed it have like a library.

SOLUTION HERE: Solution Is that R files from included library are generated to your library. instead import com.actionbarsherlock.R; use import com.myprojectalsolibrary.R;

Have you tried including

include ':LibraryB'

in your settings.gradle?

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