After updating Android Studio and gradle to 3.1, I changed all compile statements to implementation. But when I build, android studio cannot resolve imports found in 3rd party libraries.
Scenario: Main projects imports sub-module which also import a jar file.
When I try to import a class from the jar file into the main project, android studio is not able to resolve it.
How can I import the single file without having to add the jar file as a dependency in the main project?
You should use
apiinstead, it is the newcompileor have the dependency directly in your main project. Just changingimplementationtoapiwill fix the issue but you consider usingimplementationwherever possible to improve build time.You can see the difference between
apiandimplemenationhere.