Debug and Release APK

I try using command ‘ionic cordova build android --prod --release’ to generate unsigned.apk, but got some error:
Execution failed for task ‘:app:transformDexWithDexForRelease’.
Spend a lot of time to fix it but not working.

But if I use command 'ionic cordova build android --prod’, it will generate a debug.apk file.

What is the difference between debug.apk and unsiged.apk?
Can I use debug.apk for release version and upload to Google Play?

Please help.

for your error ‘:app:transformDexWithDexForRelease’ we need more logs, please add your log screen.
for your questions:

  • What is the difference between debug.apk and unsiged.apk?

debug.apk is for developing puprposes where you cand debug your APK, meanwhile unsigned.apk you cannot and it’s the version to be prepared for signing.

  • Can I use debug.apk for release version and upload to Google Play?

No, you cannot. First you to have to generate your unsigned.apk. Next, sign it using your keystore. Afterall, you can upload your APK to Google Play