An Android app uses a library (aar module) that uses "com.google.gson.Gson". The library has the following in its build.gradle:
compile 'com.google.code.gson:gson:2.6.2'
The app builds fine, but generates the following error when it starts:
Failed resolution of: Lcom/google/gson/Gson;
The only way to solve it is adding the same compile line to the app's build.gradle:
compile 'com.google.code.gson:gson:2.6.2'
Could anyone shed some light on this?
[Edit]
The library was added with the standard procedure that created a folder under the app called "androidLibrary-release". The following line has been added to the build.gradle of the app:
compile project(':androidLibrary-release')