Tuladhar
Tuladhar

Reputation: 27

Ionic Android Application not building

C:\Users\Tuladhar\WebstormProjects\myproject>ionic cordova build android [WARN] Not performing Ionic build for project type: ionic1.

cordova build android Running command: "C:\Program Files\nodejs\node.exe" C:\Users\Tuladhar\WebstormProjects\myproject\hooks\after_prepare\010_add_platform_class.js C:\Users\Tuladhar\WebstormProjects\myproject

add to body class: platform-android ANDROID_HOME=C:\Users\Tuladhar\AppData\Local\Android\android-sdk JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121 Subproject Path: CordovaLib 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_859uxik73yildsrgrru9xamjo.run(C:\Users\Tuladhar\WebstormProjects\myproject\platforms\android\build.gradle:141)

BUILD FAILED

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

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

Upvotes: 0

Views: 1175

Answers (1)

Shashan Sooriyahetti
Shashan Sooriyahetti

Reputation: 878

1.Remove platforms (you can delete it from folder)

2.Remove node_modules (you can delete it from folder)

3.Upgrade your ionic-cli version to the latest (npm update -g ionic )

4.run npm install

5.run ionic cordova platform add android

6.run ionic cordova run android

Try these steps accordingly and it will work. If not try updating android api and sdk tools and re-do the steps.

Upvotes: 1

Related Questions