triniwiz / nativescript-downloader

Apache License 2.0
32 stars 18 forks source link

Unable to merge dex after update to 4.0.0 #10

Closed LorenDorez closed 6 years ago

LorenDorez commented 6 years ago

Which platform(s) does your issue occur on?

Anroid

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

I recently updated to {N} version 4 and now i get the error stated when i add this plugin

Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
triniwiz commented 6 years ago

You can try the following

  1. Add this to your app.gradle located in the App_Resources/android
    android {
    defaultConfig {
       multiDexEnabled true
    }
    }

Or

  1. Add this to your app.gradle located in the App_Resources/android

    configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
    def requested = details.requested
    if (requested.group == 'com.android.support') {
        if (!requested.name.startsWith("multidex")) {
            details.useVersion '27.1.1'
        }
     }
    
    }
    }
LorenDorez commented 6 years ago

@triniwiz

The 1st option gave me a new error about duplicate Zip entry. The 2nd one appears to work.

racknoris commented 6 years ago

@triniwiz If i'm using NS 4.2.0, and your 1st option, what version should be in the details.useVersion? Does it matter if it's 27.1.1? Is there a way to match it with what i've been using until now? It's just, I got this error just today after months of working on the same project