# Error in building

**URL:** <https://forum.ionicframework.com/t/error-in-building/69415>\
**Category:** ionic-v1\
**Created:** [November 7, 2016, 2:12pm UTC](https://forum.ionicframework.com/t/error-in-building/69415 "2016-11-07T14:12:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Misiaczek](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@Misiaczek](https://forum.ionicframework.com/u/Misiaczek)\
**Post date:** [November 7, 2016, 2:12pm UTC](https://forum.ionicframework.com/t/error-in-building/69415/1 "2016-11-07T14:12:05Z")

</div>

Hello I have frustrating error in ionic build package. I can`t find any resolution on web.

```
You have been opted out of telemetry. To change this, run: cordova telemetry on.
ANDROID_HOME=/usr/local/src/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-8-oracle

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not find any version that matches com.google.android.gms:play-services-gcm:9.8+.
     Searched in the following locations:
         https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml
         https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/
         file:/usr/local/src/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml
         file:/usr/local/src/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-gcm/
         file:/usr/local/src/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml
     Required by:
         :android:unspecified

* 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: 2.797 secs
Error: Error code 1 for command: /home/package/workspace/apps-ed16775e-227/cordova/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/package/workspace/apps-ed16775e-227/cordova/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
```

---

<div class="post-metadata">

**Author:** ![baviskarmitesh](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@baviskarmitesh](https://forum.ionicframework.com/u/baviskarmitesh)\
**Post date:** [November 8, 2016, 7:26am UTC](https://forum.ionicframework.com/t/error-in-building/69415/2 "2016-11-08T07:26:41Z")

</div>

This may be due to google play services may be included in your project more than once. Go to Build.graddle file and verify it properly

---

<div class="post-metadata">

**Author:** ![dotzilla](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dotzilla/32/104418_2.png) [@dotzilla](https://forum.ionicframework.com/u/dotzilla)\
**Post date:** [November 8, 2016, 12:01pm UTC](https://forum.ionicframework.com/t/error-in-building/69415/3 "2016-11-08T12:01:48Z")

</div>

**locally:** update your android tools through Android SDK Manager by scrolling down to “Extras”. Make sure that all Google Play services/libraries and “Google Repository” are up to date. Then build again.

**ionic cloud:** wait for an actual fix from team ionic. meanwhile build your APKs locally.

More info on this topic can be found here:

> [@Ionic Package: Android builds failing](https://forum.ionicframework.com/t/ionic-package-android-builds-failing/68874):
>
> Hi Ionic, Since the update to the new app-scripts@0.0.39, I have had problems building with ionic package build android --profile prod --release: You have been opted out of telemetry. To change this, run: cordova telemetry on. ANDROID\_HOME=/usr/local/src/android-sdk-linux JAVA\_HOME=/usr/lib/jvm/java-8-oracle FAILURE: Build failed with an exception. \* What went wrong: A problem occurred configuring root project 'android'. \> Could not resolve all dependencies for configuration ':\_debugCompile'…

And here:

> <https://github.com/ionic-team/legacy-ionic-cloud/issues/88>
>
> Since the update to the new app-scripts@0.0.39, I have had problems building for… Android with either \`ionic package build android --profile dev\` or \`ionic package build android --profile prod --release\`:
> 
> \`\`\`
> You have been opted out of telemetry. To change this, run: cordova telemetry on.
> ANDROID\_HOME=/usr/local/src/android-sdk-linux
> JAVA\_HOME=/usr/lib/jvm/java-8-oracle
> 
> FAILURE: Build failed with an exception.
> 
> \* What went wrong:
> A problem occurred configuring root project 'android'.
> \> Could not resolve all dependencies for configuration ':\_debugCompile'.
> \> Could not find any version that matches com.google.android.gms:play-services-gcm:9.8+.
> Searched in the following locations:
> https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml
> https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/
> file:/usr/local/src/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml
> file:/usr/local/src/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-gcm/
> file:/usr/local/src/android-sdk-linux/extras/google/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml
> Required by:
> :android:unspecified
> 
> \* 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: 2.939 secs
> Error: Error code 1 for command: /home/package/workspace/apps-abae991f-67/cordova/platforms/android/gradlew with args: cdvBuildRelease,-b,/home/package/workspace/apps-abae991f-67/cordova/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
> \`\`\`
> 
> My \`config.xml\` plugins are below:
> \`\`\`
> \<plugin name="cordova-plugin-device" spec="~1.1.3"/\>
> \<plugin name="cordova-plugin-console" spec="~1.0.4"/\>
> \<plugin name="cordova-plugin-whitelist" spec="~1.3.0"/\>
> \<plugin name="cordova-plugin-statusbar" spec="~2.2.0"/\>
> \<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/\>
> \<plugin name="cordova-plugin-network-information" spec="~1.3.0"/\>
> \<plugin name="phonegap-plugin-push" spec="~1.8.4"\>
> \<variable name="SENDER\_ID" value="\*\*\*\*\*\*\*\*\*\*\*\*\*\*"/\>
> \</plugin\>
> \<plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/\>
> \<plugin name="cordova-plugin-camera" spec="~2.2.0"/\>
> \`\`\`
> 
> The community has \[confimed\](https://forum.ionicframework.com/t/ionic-package-android-builds-failing/68874/10?u=shinglesmingles) that the issue is with \`phonegap-plugin-push\` (removing the plugin from \`config.xml\` builds without error) and that \`ionic build android\` works fine locally (with updated Google Support Repo).
