0

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!

2
  • do not edit your already answered question in the way it change its meaning (as you just did). I rolled your edit back. In future, if you want to ask about something else either ask new question or append new content to existing question (people usually mark it with ***EDIT*** or so, to make it clear). Commented Apr 30, 2015 at 17:43
  • @MarcinOrlowski how did adding 'I can successfully build it in android studio' changed the meaning? + nobody said anything related to the content I added, I just made it clear that I can compile it, but not through command line, which was my goal. Commented Apr 30, 2015 at 19:03

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

android create project has been updated since Android Studio became the official IDE (sadly).
0

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

ant debug
adb install bin/HelloWorld-debug.apk

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.