Unable to build Ionic app on android


#1

Following is log produce when trying to build with

ionic cordova run android


[10:31:57]  lint finished in 8.68 s
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

:wrapper


BUILD SUCCESSFUL

Total time: 29.565 secs
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
+-----------------------------------------------------------------
| cordova-android-support-gradle-release: 27.+
+-----------------------------------------------------------------
null

google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.
please apply google-services plugin at the bottom of the build file.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_bc2mqxmyor9tensjg5hiw98y9.run(C:\Users\Designbee\Documents\GitHub\driverApp\platforms\android\build.gradle:144)
org.xwalk:xwalk_core_library:23+
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.

:preBuild UP-TO-DATE
:preArmv7DebugBuild UP-TO-DATE
:checkArmv7DebugManifest
:preArmv7ReleaseBuild UP-TO-DATE
:preX86DebugBuild UP-TO-DATE
:preX86ReleaseBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl

:CordovaLib:compileDebugNdk

UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint
 UP-TO-DATE
:CordovaLib:mergeDebugShaders

:CordovaLib:compileDebugShaders

:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets

:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript

UP-TO-DATE
:CordovaLib:compileDebugRenderscript

:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources

:CordovaLib:processDebugManifest

:CordovaLib:generateDebugBuildConfig

:CordovaLib:processDebugResources

:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard

:CordovaLib:compileDebugJavaWithJavac

:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes

UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug

:CordovaLib:mergeDebugJniLibFolders

:CordovaLib:transformNative_libsWithMergeJniLibsForDebug

:CordovaLib:transformNative_libsWithSyncJniLibsForDebug

:CordovaLib:bundleDebug

:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl

:CordovaLib:compileReleaseNdk

UP-TO-DATE
:CordovaLib:copyReleaseLint
 UP-TO-DATE

:CordovaLib:mergeReleaseShaders

:CordovaLib:compileReleaseShaders

:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets

:CordovaLib:mergeReleaseProguardFiles

:CordovaLib:packageReleaseRenderscript

UP-TO-DATE
:CordovaLib:compileReleaseRenderscript

:CordovaLib:generateReleaseResValues

:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources

:CordovaLib:processReleaseManifest

:CordovaLib:generateReleaseBuildConfig

:CordovaLib:processReleaseResources

:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard

:CordovaLib:compileReleaseJavaWithJavac

:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes
 UP-TO-DATE

:CordovaLib:transformResourcesWithMergeJavaResForRelease

:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease

:CordovaLib:mergeReleaseJniLibFolders

:CordovaLib:transformNative_libsWithMergeJniLibsForRelease

:CordovaLib:transformNative_libsWithSyncJniLibsForRelease

:CordovaLib:bundleRelease

:prepareAndroidArchCoreRuntime110Library

:prepareAndroidArchLifecycleLivedataCore110Library

:prepareAndroidArchLifecycleRuntime110Library

:prepareAndroidArchLifecycleViewmodel110Library

:prepareComAndroidSupportSupportCompat2711Library

:prepareComAndroidSupportSupportCoreUi2711Library

:prepareComAndroidSupportSupportCoreUtils2711Library

:prepareComAndroidSupportSupportFragment2711Library

:prepareComAndroidSupportSupportMediaCompat2711Library

:prepareComAndroidSupportSupportV42711Library

:prepareComGoogleAndroidGmsPlayServicesAdsIdentifier1600Library

:prepareComGoogleAndroidGmsPlayServicesBase1601Library

:prepareComGoogleAndroidGmsPlayServicesBasement1601Library

:prepareComGoogleAndroidGmsPlayServicesMeasurementApi1603Library

:prepareComGoogleAndroidGmsPlayServicesMeasurementBase1604Library

:prepareComGoogleAndroidGmsPlayServicesStats1601Library

:prepareComGoogleAndroidGmsPlayServicesTasks1601Library

:prepareComGoogleFirebaseFirebaseAnalytics1605Library

:prepareComGoogleFirebaseFirebaseAnalyticsImpl1623Library

:prepareComGoogleFirebaseFirebaseCommon1603Library

:prepareComGoogleFirebaseFirebaseCore1605Library

:prepareComGoogleFirebaseFirebaseIid1704Library

:prepareComGoogleFirebaseFirebaseIidInterop1601Library

:prepareComGoogleFirebaseFirebaseMeasurementConnector1701Library

:prepareComGoogleFirebaseFirebaseMeasurementConnectorImpl1703Library

:prepareComGoogleFirebaseFirebaseMessaging1734Library

:prepareOrgApacheCordovaCordovaLib630DebugLibrary

:prepareOrgXwalkXwalk_core_library23535894Library

:prepareArmv7DebugDependencies
:compileArmv7DebugAidl

:compileArmv7DebugRenderscript

:generateArmv7DebugBuildConfig

:mergeArmv7DebugShaders

:compileArmv7DebugShaders

:generateArmv7DebugAssets
:mergeArmv7DebugAssets

:createXwalkCommandLineFileArmv7Debug
:generateArmv7DebugResValues

:processArmv7DebugGoogleServices
Parsing json file: C:\Users\Designbee\Documents\GitHub\driverApp\platforms\android\google-services.json
:generateArmv7DebugResources

:mergeArmv7DebugResources

:processArmv7DebugManifest

:processArmv7DebugResources

:generateArmv7DebugSources
:incrementalArmv7DebugJavaCompilationSafeguard

:compileArmv7DebugJavaWithJavac

:compileArmv7DebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:compileArmv7DebugNdk
 UP-TO-DATE

:compileArmv7DebugSources

:transformClassesWithDexForArmv7Debug
 FAILED

BUILD FAILED

Total time: 3 mins 32.923 secs

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithDexForArmv7Debug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/PermissionHelper;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: 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 or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithDexForArmv7Debug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lorg/apache/cordova/PermissionHelper;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

[ERROR] An error occurred while running cordova run android (exit code 1).

> Here is the Ionic Info


    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.0.0
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.7.1

System:

    Android SDK Tools : 26.1.1
    Node              : v6.11.3
    npm               : 6.1.0
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\Designbee\AppData\Local\Android\sdk

Misc:

    backend : pro

What the possible cause need some help

Thanks.


#2

Check this link Help with BUILD FAILED Android Ionic