Ion assembly

I am very new to the ionic framework, however, I started working on Windows 7, but now I am trying to create an Android application with ionic infrastructure, and I have completed the following steps.

>npm install -g cordova
>npm install -g ionic
>ionic start resistance blank
>cd resistance
>ionic platform add android

So far I am doing fine, but when I run the command

>ionic build android

I get the following error

    C:\Users\vishwant\resistance>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\vishwant\resistance\hooks\after_prepare\010_add_platform_class.js C:\Users\vishwant\resis
tance
add to body class: platform-android
Running command: C:\Users\vishwant\resistance\platforms\android\cordova\build.bat

C:\Users\vishwant\resistance\platforms\android\cordova\node_modules\q\q.js:126
                    throw e;
                          ^
Error: ENOENT, no such file or directory 'C:\adt-bundle-windows-x86_64-20140702\sdk\tools\tools\lib\build.template'
    at Object.fs.openSync (fs.js:432:18)
    at Object.fs.readFileSync (fs.js:289:15)
    at C:\Users\vishwant\resistance\platforms\android\cordova\lib\build.js:120:40
    at _fulfilled (C:\Users\vishwant\resistance\platforms\android\cordova\node_modules\q\q.js:798:54)
    at self.promiseDispatch.done (C:\Users\vishwant\resistance\platforms\android\cordova\node_modules\q\q.js:827:30)
    at Promise.promise.promiseDispatch (C:\Users\vishwant\resistance\platforms\android\cordova\node_modules\q\q.js:760:13)
    at C:\Users\vishwant\resistance\platforms\android\cordova\node_modules\q\q.js:574:44
    at flush (C:\Users\vishwant\resistance\platforms\android\cordova\node_modules\q\q.js:108:17)
    at process._tickCallback (node.js:419:13)
Error: C:\Users\vishwant\resistance\platforms\android\cordova\build.bat: Command failed with exit code 8
    at ChildProcess.whenDone (C:\Users\vishwant\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

I noticed that the path is incorrect, but in the path variable I correctly configured ie to the tools.

Error: ENOENT, there is no such file or directory 'C: \ ADT-window package-x86_64-20140702 \ SDK \ tools \ tools \ Lib \ build.template'

Firstly, I don’t understand why he attaches another tool \ and is looking for build.template Secondly, if I manually create additional tools \ a folder inside the tools \ (which I want to avoid), then this error is higher, but I will shown

C:\Users\vishwant\resistance>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\vishwant\resistance\hooks\after_prepare\010_add_platform_class.js C:\Users\vishwant\resis
tance
add to body class: platform-android
Running command: C:\Users\vishwant\resistance\platforms\android\cordova\build.bat
[Error: Please install Android target "android-19".
Hint: Run "android" from your command-line to open the SDK manager.]
Error: C:\Users\vishwant\resistance\platforms\android\cordova\build.bat: Command failed with exit code 2
    at ChildProcess.whenDone (C:\Users\vishwant\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)
    at Process.ChildProcess._handle.onexit (child_process.js:823:5)

sroid android 4.4W, cordova, , .

, , - .

+4
4

, ANDROID_HOME .

ANDROID_HOME SDK android SDK, :

SET ANDROID_HOME=C:\adt-bundle-windows-x86_64-20140702\sdk

.

SET PATH=%PATH%;%ANDROID_HOME%\tools

(, Windows env vars, cmd, )

+10

Mac OSX: bashprofile

~ nano .bash_profile

export ANDROID_HOME=/usr/local/<path_to_your_androidsdk>/
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

ionic build android

, ,

+3

export PATH=$PATH:$ANDROID_HOME/bin

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

, :)

+1

, sdk Android .

, :

SET ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk

SET PATH=%PATH%;%ANDROID_HOME%\tools

.

0

All Articles