This is mostly Duplicate of build fail for android but no answer is yet available and my scenario is little different so putting it again.
In my my case I am able to build apk properly and I want to create a app bundle after successful of command
ionic cordova build android --prod --release
by running this cmd I am able to generate the apk.
After that I am going to /platform/android
and running ./gradlew bundle
and here I am getting this error
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
FAILURE: Build failed with an exception.
* What went wrong:
Task 'bundle' is ambiguous in root project 'android'. Candidates are: 'bundleAppClassesDebug', 'bundleAppClassesDebugAndroidTest', 'bundleAppClassesDebugUnitTest', 'bundleAppClassesRelease', 'bundleAppClassesReleaseUnitTest', 'bundleDebug', 'bundleRelease'
How to fix it?