How to fix the compilation error in android in ionic3?

Friends,
When I try to compile and build apk using command

ionic cordova run android

I got error as

Execution failed for task ':preDebugBuild'.

  Android dependency 'com.android.support:support-v4' has different version for the compile (26.0.0-alpha1) and runtime (27.0.2) classpath. You should manually set the same version via DependencyResolution

Please advise how it fix ?

Thanks
Anes

@anespa

Please try 
1. rm -rf node_modules 
followed by 
2. npm install

Your solution fix my problem…

but one typo in command : > rm -rf node_modules

thanks alot

Anes

1 Like