Android Build Exception


I’m getting this exception when trying to run “ionic build android --stacktrace”

solitaire:gamebeacon james$ ionic build android --stacktrace
Running command: /Users/james/xdev/bucket/gamebeacon/hooks/after_prepare/010_add_platform_class.js /Users/james/xdev/bucket/gamebeacon
add to body class: platform-android
Running command: /Users/james/xdev/bucket/gamebeacon/platforms/android/cordova/build 
Running: /Users/james/xdev/bucket/gamebeacon/platforms/android/gradlew cdvBuildDebug -b /Users/james/xdev/bucket/gamebeacon/platforms/android/build.gradle -Dorg.gradle.daemon=true

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
     Searched in the following locations:
     Required by:

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


Total time: 2.375 secs

                    throw e;
Error code 1 for command: /Users/james/xdev/bucket/gamebeacon/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/james/xdev/bucket/gamebeacon/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/james/xdev/bucket/gamebeacon/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/james/xdev/bucket/gamebeacon/platforms/android/cordova/build: Command failed with exit code 1
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
solitaire:gamebeacon james$ 

I’ve tried using “cordova build android”. Same error.
I’ve tried starting the project from scratch and laboriously copying files over and reinstalling everything. Same error.

Anyone able to help?

I’m on OSX.

Ionic 2 + Facebook (Cannot find 'facebookConnectPlugin')

Your Android SDK may be not complete, you are missing some parts of it. Start the SDK manager and select for installing all the packages under Extras.

You’ll get probably more than you need but it should fix your problem.


Ah! I got the odd error, such as

    Note: /Users/james/xdev/bucket/gamebeacon/platforms/android/src/com/plugin/gcm/ uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

But ultimately a “BUILD SUCCESSFUL” message :smiley: