I recently downloaded the ViewPagerIndicator library and imported it into android studio. After adding it to my project I get a rendering error "The following classes could not be found:" and points to com.viewpagerindicator.IconPageIndicator.
The steps I took were Files->Import Module->'library name'
, Project Structure -> Dependencies -> + the imported module
. Then to my layout xml file I added the <com.viewpagerindicator.IconPageIndicator />
, after that I got the missing class problem.
It compiles just fine and I went through all of the build.gradle and settings.gradle files and compared them to what they should be online.
MyApp->build.gradle
has compile project(':library')
under dependencies
settings.gradle
has include ':library'
with no build errors.
I had the same problem. I just did: Invalidate / Restart ..
I too had trouble importing module as it was not appearing in list of modules. And way it worked for me is manually entering it in settings.gradle this way:
And in build.gradle
First of all, you must import your library project by following that path:
After you have imported the library project successfully, you must check your build.gradle file inside your project's folder if the following line is present at the "dependencies" section:
Then your project must be built successfully.
The following solution worked for me,just two steps.
Go to your project structure on android studio, select project from left side.Change Android plugin version to Gradle version press ok.
If error occurs after synchronization again go to project structure and select project.undo the android plugin version like before.Gradle will align the library and make the class visible to XML files.
In my case, I did add in app gradle:
but it only works when I change
in app and the other modules are the same.
I found that my issue was the Android Plugin Version under Project Structure --> Project was different to the version my plugins all used. Once I aligned them to the same version, I could see all my classes from my imported module.
Took me hours :(