I'm using react-native-device-info library in react-native. I've used it for about a year without problems, but since the last two weeks the app on Android crashes because of this library.
I get an error as follows:
They discussed about this issue here. And they explanation is as follows:
Unable to merge dex / Multiple dex files / Problems with
com.google.android.gms
react-native-device-info uses com.google.android.gms:play-services-gcm to provide [getInstance()][#getinstance]. This can lead to conflicts when building the Android application.If you're using a different version of com.google.android.gms:play-services-gcm in your app, you can define the googlePlayServicesVersion gradle variable in your build.gradle file to tell react-native-device-info what version it should require.
If you're using a different library that conflicts with com.google.android.gms:play-services-gcm, you can simply ignore this dependency in your gradle file:
compile(project(':react-native-device-info')) { exclude group: 'com.google.android.gms' }
I've tried to add that code to build.gradle
but nothing happens, the sam problem.
I'm not sure how to solve it. Any idea?