My ionic app in browser works perfect, but in android has a fail when I try to compile or build the apk.
If I execute “ionic cordova run android --l --verbose” I have the following error:
Error: E:\ionic\myApp\platforms\android\gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
D8: Program type already present: android.support.v4.app.INotificationSideChannelFAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForDebug’.com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at Adicionar dependências de compilação | Android Studio | Android Developers.
Program type already present: android.support.v4.app.INotificationSideChannel
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.Get more help at https://help.gradle.org
BUILD FAILED in 2m 20s
at ChildProcess.whenDone (E:\ionic\myApp\node_modules\cordova-common\src\superspawn.js:135:23)
at ChildProcess.emit (events.js:210:5)
at ChildProcess.cp.emit (E:\ionic\myApp\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
I’ve been searching about the error, and I’ve tried the following things.
- Remove android platform and create again.
- Add to build.gradle multiDexEnabled true .
- Clear cordova cache.
None of the above worked.