Failed to build ionic app for android on my windows PC‏


#1

Here’s the complete CLI commands and messages…

C:\Users\santosh\iloveandaman>ionic build android
cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\icon\drawable-ldpi-icon.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\icon\drawable-mdpi-icon.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\icon\drawable-hdpi-icon.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\icon\drawable-xhdpi-icon.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\icon\drawable-xxhdpi-icon.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\icon\drawable-xxxhdpi-icon.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-land-ldpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-land-mdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-land-hdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-land-xhdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-land-xxhdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-land-xxxhdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-port-ldpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-port-mdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-port-hdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-port-xhdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-port-xxhdpi-screen.png

cp: no such file or directory: C:\Users\santosh\iloveandaman\resources\android\splash\drawable-port-xxxhdpi-screen.png

Running command: “C:\Program Files (x86)\nodejs\node.exe” C:\Users\santosh\iloveandaman\hooks\after_prepare\010_add_platform_class.js C:\Users\santosh\iloveandaman
add to body class: platform-android
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files (x86)\java\jdk1.6.0

BUILD FAILED

Total time: 1.375 secs
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.

Could not resolve all dependencies for configuration ‘:classpath’.
Could not resolve com.android.tools.build:gradle:1.5.0.
Required by:
:android:unspecified
Could not resolve com.android.tools.build:gradle:1.5.0.
Could not get resource ‘https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.5.0/gradle-1.5.0.pom’.
Could not GET ‘https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.5.0/gradle-1.5.0.pom’.
repo1.maven.org

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"C:\Users\santosh\iloveandaman\platforms\android\gradlew cdvBuildDebug -b C:\Users\santosh\iloveandaman\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
    You may not have the required environment or OS to build this project
    Error: Error code 1 for command: cmd with args: /s,/c,“C:\Users\santosh\iloveandaman\platforms\android\gradlew cdvBuildDebug -b C:\Users\santosh\iloveandaman\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true”

#2

Hi!

You can try this.

  1. put the icon and splash image inside the resources folder (eg. icon.psd & splash.psd)
  2. run ionic resources

This will generate the resources