Reputation: 5095
I am trying to create a simple JAR file like here and execute it in the shell. i am stuck on this line
dx --dex --output=foo.jar Foo.class
when i execute this line in CMD . I am always getting an error like this
trouble processing:
class name (com/delvix2/Foo) does not match path (C:/somepathhere/classes/com/delvix2/Foo.class)
...while parsing C:/somepathhere/classes/com/delvix2/Foo.class
...while processing C:/somepathhere/classes/com/delvix2/Foo.class
1 warning
no classfiles specified
How can I fix this issue?
Upvotes: 2
Views: 931
Reputation: 51
This works for me.
dx --dex --output="full path to dex file\file.dex" "c:\.....path to folder which contains the class file only"
First path : full path to dex file including the name of the dex file you want
Second path : Path to a folder which contains "ONLY" your .class
file.
(Just give the path up to the folder, don't give the class file name)
Upvotes: 3
Reputation: 510
I tried all this, and did not work. There's something that worked for me, and it was to put your classes in \sdk-path\platforms-tools\
. For example,
C:\sdk-path\platforms-tools\dx --dex --output=class.dex com\mypack\app\myclass.class
And myclass.class lives in,
C:\sdk-path\platforms-tools\com\mypack\app\myclass.class
This is crappy, but the only thing that worked.
Upvotes: 0
Reputation: 21
Use the --no-strict
option:
dx --dex --no-strict --output=foo.jar Foo.class
Upvotes: 2
Reputation: 1179
It must be in your case
dx --dex --output=C:\classes.dex C:\temp\Foo.jar
and then you must use
aapt add C:\temp\Foo.jar C:\classes.dex
I hope it will be work
Upvotes: 0
Reputation: 20272
It looks like dx expects that the relative path of the class that you give it will match it's package. Try this instead:
cd c:/somepathhere/classes
dx --dex --output=foo.jar com/delvix2/Foo.class
Upvotes: 2