Managing android projects from command line
Asked Answered
J

2

7

I am managing and running my android app from command line without using ant, I followed these steps:

  • generate R.java
  • compile R.java and all .java files in src to .class files
  • assembling set of class files into dex file using the command below
    dx --dex --verbose --output=./bin/classes.dex ./bin

.class files are in bin directory.

But I'm getting the following errors in these steps:

java.lang.Runtime exception:.\bin file not found 
at com.android.dx.cf.direct.ClassPathOpener.process
at com.android.dx.command.dexer.Main.processOne
at com.android.dx.command.dexer.Main.processAllFiles
at com.android.dx.command.dexer.Main..run
at com.android.dx.command.dexer.Main.main
at com.android.dx.command.Main.main

Due to this, I'm unable to create the Classes.dex file.

Can someone suggest a solution for this?

[not using eclipse and ant only through command line]

Jerrodjerrol answered 25/8, 2011 at 13:15 Comment(2)
if I use any IDE means ..............i cant able to get to know abt the whole process............so that only just if it is command line ...........I get know abt each and every step by step processJerrodjerrol
thanx man,.......I got it worked...........it is due to the dx.bat file...........in dx.bat file there was set javaOpts= and i deleted it ....................it is due memory shortage......thanx,rajJerrodjerrol
A
0

If you need to "manage your Android projects from command line", when you should use Ant build.

Ant's build.xml is a official standardized way to build Android projects. Ant scripts can do anything you may need to build your project.

If you want most modern build tools for Android, you can look at Gradle for Android projects. Note: today it's still in alpha stage.

Adiel answered 4/10, 2012 at 8:20 Comment(0)
H
0

Try entering the full path instead of the relative path.

Also you must put the class files inside a directory named exactly like it's package name. for example for com.test.me.MyActivity you must use com/test/me/MyActivity.class

And since we are on the topic, remember that dx can only work with class files created using Java6 (or less) so if you are using java7 to compile your code, add "source 1.6 target 1.6" parameters to your command line.

Herne answered 18/6, 2013 at 13:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.