I am working in an Android project using Android Studio.
This project is an app that uses some third party libraries. One of them uses Google Play Services 8.4.0, but my app uses Google Play Services 9.2.0, and I need to use this version to some specific features of the app.
When I compile and execute the application with this dependencies
compile 'com.google.android.gms:play-services-gcm:9.2.0' compile 'com.google.android.gms:play-services-location:9.2.0'
I get this error (in summary) when I execute the app and the code of the third part library is executed:
FATAL EXCEPTION: main Process: com.example.app, PID: 507 java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/maps/model/LatLng; Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.model.LatLng" on path: DexPathList
If I downgrade the Google Play Services version to 8.4.0 it works ok, the problem is that I have to remove my app Google Play Services 9.2.0 features from the app.
Is there a way to force the third party library to use its own Google Play Services Library version and allow my app to use last Google Play Services version?