Android Build Failed



  • So I am trying to build for release an Android app using beta 7. Keystore is setup and as far as I can tell the AndroidManifest.xml is correct. The build history says to check these files. The log generated shows the below. I am uncertain of why the build would fail with this specific error: more than one library with package name 'com.google.android.gms'

    Any thoughts?

    Edit: Success! Third time is the charm. I removed the camera and monaca backend plugin as they weren’t being used and tried again, this time it worked!

    Temporary folder: /private/tmp/monaca/56f612157e2193c04131a75a
    Downloading project
    Download complete
    Running for 5.2
    plugin add mobi.monaca.plugins.Monaca@3.0.0
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin "mobi.monaca.plugins.Monaca@3.0.0" via npm
    Installing "mobi.monaca.plugins.Monaca" for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add mobi.monaca.plugins.MonacaBackend@1.0.1
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin "mobi.monaca.plugins.MonacaBackend@1.0.1" via npm
    Installing "mobi.monaca.plugins.MonacaBackend" for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-admobpro
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Installing "cordova-plugin-admobpro" for android
    Fetching plugin "cordova-plugin-extension" via npm
    Installing "cordova-plugin-extension" for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add org.apache.cordova.speech.speechrecognition
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Installing "org.apache.cordova.speech.speechrecognition" for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add org.apache.cordova.speech.speechsynthesis
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Installing "org.apache.cordova.speech.speechsynthesis" for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-whitelist@1.0.0
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin "cordova-plugin-whitelist@1.0.0" via npm
    Installing "cordova-plugin-whitelist" for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-splashscreen@2.1.0
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin "cordova-plugin-splashscreen@2.1.0" via npm
    Installing "cordova-plugin-splashscreen" for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-camera@1.2.0
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin "cordova-plugin-camera@1.2.0" via npm
    Installing "cordova-plugin-camera" for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    Project has 8 plugins.
    9 plugins has been installed.
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Running command: /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/hooks/after_prepare/monaca_enterprise_android.js /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Running command: /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/platforms/android/cordova/build --release
    ANDROID_HOME=/Applications/android-sdk-macosx
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
    Running: /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/platforms/android/gradlew cdvBuildRelease -b /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/platforms/android/build.gradle -Dorg.gradle.daemon=true
    :preBuild
    :preReleaseBuild
    :checkReleaseManifest
    :CordovaLib:compileLint
    :CordovaLib:copyReleaseLint UP-TO-DATE
    :CordovaLib:mergeReleaseProguardFiles
    :CordovaLib:preBuild
    :CordovaLib:preReleaseBuild
    :CordovaLib:checkReleaseManifest
    :CordovaLib:prepareReleaseDependencies
    :CordovaLib:compileReleaseAidl
    :CordovaLib:compileReleaseRenderscript
    :CordovaLib:generateReleaseBuildConfig
    :CordovaLib:generateReleaseAssets UP-TO-DATE
    :CordovaLib:mergeReleaseAssets
    :CordovaLib:generateReleaseResValues
    :CordovaLib:generateReleaseResources
    :CordovaLib:packageReleaseResources
    :CordovaLib:processReleaseManifest
    :CordovaLib:processReleaseResources
    :CordovaLib:generateReleaseSources
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    :CordovaLib:compileReleaseJava
    :CordovaLib:processReleaseJavaRes UP-TO-DATE
    :CordovaLib:packageReleaseJar
    :CordovaLib:compileReleaseNdk
    :CordovaLib:packageReleaseJniLibs UP-TO-DATE
    :CordovaLib:packageReleaseLocalJar UP-TO-DATE
    :CordovaLib:packageReleaseRenderscript UP-TO-DATE
    :CordovaLib:bundleRelease
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileLint
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:copyReleaseLint UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:mergeReleaseProguardFiles
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:preBuild
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:preReleaseBuild
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:checkReleaseManifest
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:prepareAndroidCordovaLibUnspecifiedReleaseLibrary
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:prepareReleaseDependencies
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileReleaseAidl
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileReleaseRenderscript
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateReleaseBuildConfig
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateReleaseAssets UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:mergeReleaseAssets
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateReleaseResValues
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateReleaseResources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:mergeReleaseResources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:processReleaseManifest
    warning: string 'auth_client_needs_enabling_title' has no default translation.
    warning: string 'auth_client_needs_installation_title' has no default translation.
    warning: string 'auth_client_needs_update_title' has no default translation.
    warning: string 'auth_client_play_services_err_notification_msg' has no default translation.
    warning: string 'auth_client_requested_by_msg' has no default translation.
    warning: string 'auth_client_using_bad_version_title' has no default translation.
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:processReleaseResources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateReleaseSources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileReleaseJava
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:processReleaseJavaRes UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageReleaseJar
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileReleaseNdk
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageReleaseJniLibs UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageReleaseLocalJar
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageReleaseRenderscript UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageReleaseResources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:bundleRelease
    :prepareAndroidCordovaLibUnspecifiedReleaseLibrary
    :prepareAndroidMobiMonacaPluginsMonacaBackendGooglePlayServices_libUnspecifiedReleaseLibrary
    :preDebugBuild
    :CordovaLib:copyDebugLint UP-TO-DATE
    :CordovaLib:mergeDebugProguardFiles
    :CordovaLib:preDebugBuild
    :CordovaLib:checkDebugManifest
    :CordovaLib:prepareDebugDependencies
    :CordovaLib:compileDebugAidl
    :CordovaLib:compileDebugRenderscript
    :CordovaLib:generateDebugBuildConfig
    :CordovaLib:generateDebugAssets UP-TO-DATE
    :CordovaLib:mergeDebugAssets
    :CordovaLib:generateDebugResValues
    :CordovaLib:generateDebugResources
    :CordovaLib:packageDebugResources
    :CordovaLib:processDebugManifest
    :CordovaLib:processDebugResources
    :CordovaLib:generateDebugSources
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    :CordovaLib:compileDebugJava
    :CordovaLib:processDebugJavaRes UP-TO-DATE
    :CordovaLib:packageDebugJar
    :CordovaLib:compileDebugNdk
    :CordovaLib:packageDebugJniLibs UP-TO-DATE
    :CordovaLib:packageDebugLocalJar UP-TO-DATE
    :CordovaLib:packageDebugRenderscript UP-TO-DATE
    :CordovaLib:bundleDebug
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:copyDebugLint UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:mergeDebugProguardFiles
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:preDebugBuild
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:checkDebugManifest
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:preDebugTestBuild
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:prepareAndroidCordovaLibUnspecifiedDebugLibrary
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:prepareDebugDependencies
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileDebugAidl
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileDebugRenderscript
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateDebugBuildConfig
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateDebugAssets UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:mergeDebugAssets
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateDebugResValues
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateDebugResources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:mergeDebugResources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:processDebugManifest
    warning: string 'auth_client_needs_enabling_title' has no default translation.
    warning: string 'auth_client_needs_installation_title' has no default translation.
    warning: string 'auth_client_needs_update_title' has no default translation.
    warning: string 'auth_client_play_services_err_notification_msg' has no default translation.
    warning: string 'auth_client_requested_by_msg' has no default translation.
    warning: string 'auth_client_using_bad_version_title' has no default translation.
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:processDebugResources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:generateDebugSources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileDebugJava
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:processDebugJavaRes UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageDebugJar
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:compileDebugNdk
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageDebugJniLibs UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageDebugLocalJar
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageDebugRenderscript UP-TO-DATE
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:packageDebugResources
    :mobi.monaca.plugins.MonacaBackend:google-play-services_lib:bundleDebug
    :prepareComAndroidSupportSupportV42220Library
    :prepareComGoogleAndroidGmsPlayServicesAds830Library
    :prepareComGoogleAndroidGmsPlayServicesBasement830Library
    :prepareReleaseDependencies
    :compileReleaseAidl
    :compileReleaseRenderscript
    :generateReleaseBuildConfig
    :generateReleaseAssets UP-TO-DATE
    :mergeReleaseAssets
    :generateReleaseResValues
    :generateReleaseResources
    :mergeReleaseResources
    :processReleaseManifest
    warning: string 'auth_client_needs_enabling_title' has no default translation.
    warning: string 'auth_client_needs_installation_title' has no default translation.
    warning: string 'auth_client_needs_update_title' has no default translation.
    warning: string 'auth_client_play_services_err_notification_msg' has no default translation.
    warning: string 'auth_client_requested_by_msg' has no default translation.
    warning: string 'auth_client_using_bad_version_title' has no default translation.
    :processReleaseResources FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':processReleaseResources'.
    > Error: more than one library with package name 'com.google.android.gms'
      You can temporarily disable this error with android.enforceUniquePackageName=false
      However, this is temporary and will be enforced in 1.0
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    
    Total time: 43.156 secs
    
    /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/platforms/android/cordova/node_modules/q/q.js:126
                        throw e;
                              ^
    Error code 1 for command: /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/platforms/android/gradlew with args: cdvBuildRelease,-b,/private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/platforms/android/build.gradle,-Dorg.gradle.daemon=true
    ERROR building one of the platforms: Error: /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/platforms/android/cordova/build: Command failed with exit code 8
    You may not have the required environment or OS to build this project
    Error: /private/tmp/monaca/56f612157e2193c04131a75a/android/skeleton/platforms/android/cordova/build: Command failed with exit code 8
        at ChildProcess.whenDone (/data/monaca_build_module/5.2/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
        at ChildProcess.emit (events.js:98:17)
        at maybeClose (child_process.js:755:16)
        at Process.ChildProcess._handle.onexit (child_process.js:822:5)
    Build error: Error building project source code
    

  • Onsen UI

    @munsterlander Just a quick thing, beta.8 was released yesterday and includes some bug fixes. Perhaps you’d like to check it out :)


  • Monaca

    @Fran-Diox build errors are not related to the app’s logic, so a build will never fail because of Onsen :)


  • Onsen UI

    @Andi I know. I didn’t mean that upgrading Onsen would fix his problems since he already fix them himself. I just thought that for a release version it would be better to use beta.8 rather than beta.7 since we have included some bug fixes there :P



  • @Fran-Diox @Andi Thanks for both responses. With @Fran-Diox response, I did rebuild with Beta 8. Although the bug fixes weren’t things affecting my project, they could, so why not. For @Andi, I knew the Onsen framework would not affect build, but didn’t know if there was some dependency with Monaca affecting the build. Ultimately though, we got it all working, so yay! The app is in alpha testing now.


  • Monaca

    @munsterlander I’m glad you were able to solve the issue, good luck with the testing! :D


Log in to reply