While building NS + Vue application, following error occurred -
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives
Error is because the number of method references in a .dex file cannot exceed 64K. Error also directs to the solution at https://developer.android.com/tools/building/multidex.html
This solution suggests to enable multidex for apps with over 64K methods i.e. to add multiDexEnabled true
in build.gradle
which resolves the error.
In NativeScript build.gradle
is located in platforms/
, so whenever I clean the platform with tns platform clean
or remove platforms/
, I have to again add multiDexEnabled true
in build.gradle
.
Is there any permanent solution to this?
Instead of build.gradle
in platforms/
, use app.gradle
in App_Resources/Android
.
Add multiDexEnabled true
inside android.defaultConfig
in app.gradle
file, this will persist and will not change with tns platform clean
or removing platforms/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With