Multiple Dex File error following NS 2.5 Upgrade


#1

Following the upgrade to NS 2.5 I’m receiving a build error that I’m not quite sure how to fix. The error is:

Execution failed for task ':transformClassesWithDexForF0F1F2F3F4F5F6Debug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files
define Lcom/google/android/gms/iid/MessengerCompat$1;

I’ve spent some time looking into the issue and a Multiple Dex file exception seems to normally mean that two different versions of a dependency are being referenced. Yet I can’t seem to find anything which relates to > MessengerCompat in the gradle files of any of my dependencies.

Thanks for any help!


Multiple dex files Build Error After Updating to ns 3.3 ng 4.4.1
#2

Indeed, it means that two dependencies with possibly different versions are present in the app.

I’d ask you to share the contents of your package.json. MessengerCompat is a google play services API so it can be present any one of the plugins that declare Play Services as a dependency.


#3

Thanks for the reply! Below is my package.json

{
“nativescript”: {
“id”: “org.nativescript.LibreLinkUp”,
“tns-android”: {
“version”: “2.5.0”
}
},
“dependencies”: {
“moment”: “^2.13.0”,
“moment-timezone”: “^0.5.6”,
“nativescript-cardview”: “^1.2.0”,
“nativescript-dev-typescript”: “^0.3.2”,
“nativescript-dom”: “^1.0.7”,
“nativescript-drop-down”: “^1.4.0”,
“nativescript-google-analytics”: “^0.3.5”,
“nativescript-i18n”: “0.0.9”,
“nativescript-loading-indicator”: “^2.2.1”,
“nativescript-master-technology”: “^1.0.8”,
“nativescript-materialdropdownlist”: “^1.0.14”,
“nativescript-pdf-view”: “^1.0.1”,
“nativescript-push-notifications”: “0.0.15”,
“nativescript-statusbar”: “^1.0.0”,
“nativescript-telerik-ui”: “^1.4.1”,
“nativescript-textinputlayout”: “^0.1.2”,
“tns-core-modules”: “^2.5.0”,
“validator”: “^6.2.0”
},
“devDependencies”: {
“babel-traverse”: “6.8.0”,
“babel-types”: “6.8.1”,
“babylon”: “6.8.0”,
“filewalker”: “0.1.2”,
“lazy”: “1.0.11”,
“nativescript-dev-typescript”: “^0.3.2”,
“typescript”: “^1.8.10”
}
}