user3578847
user3578847

Reputation: 447

Build application from command line

I'm trying to build an apk file from command line. I created a sample project usng the following command:

android create project --target 1 --name MyApp --path ./MyProject --activity MyActivity --package com.example.myapp

Which created the following structure:

/bin
/res
/src
/libs
AndroidManifest.xml
ant.properties
build.xml
local.properties
proguard-project.txt
project.properties

Now when I try to build the project, I get:

   $ gradle build
   gradle will not execute and completion _gradle exists.

I couldn't find any info on this error, so I ran:

   $ _gradle build
   _arguments:comparguments:312: can only be called from completion function
   user has logged on pts/7 from :0.0.

Any hints on what am I doing wrong? Thanks!

Upvotes: 0

Views: 112

Answers (2)

user3578847
user3578847

Reputation: 447

I was able to build the apk using the following lines:

ant debug
adb install bin/HelloWorld-debug.apk

Upvotes: 0

Marcin Orlowski
Marcin Orlowski

Reputation: 75629

android create project creates project in structure expected by Eclipse, not gradle based (Android Studio) projects.

Upvotes: 1

Related Questions