Dalvik VM 调用问题
我正在尝试创建一个简单的 JAR 文件,例如此处< /a> 并在 shell 中执行它。 我被困在这一行
dx --dex --output=foo.jar Foo.class
当我在 CMD 中执行这一行时, 。我总是收到这样的错误
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
如何解决此问题?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这对我有用。
dx --dex --output="dex 文件\file.dex 的完整路径" "c:\.....仅包含类文件的文件夹的路径"
第一个路径:完整路径到 dex 文件,包括您想要的 dex 文件的名称
第二个路径:“仅”包含您的
.class
文件的文件夹的路径。(只给出文件夹的路径,不要给出类文件名)
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)
看起来 dx 期望您提供的类的相对路径与其包相匹配。试试这个:
It looks like dx expects that the relative path of the class that you give it will match it's package. Try this instead:
使用
--no-strict
选项:Use the
--no-strict
option:它必须适合你的情况
,然后你必须使用
我希望它会起作用
It must be in your case
and then you must use
I hope it will be work
我尝试了这一切,但没有成功。有一些东西对我有用,那就是把你的类放在
\sdk-path\platforms-tools\
中。例如,myclass.class 存在于,
这是蹩脚的,但唯一有效的。
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,And myclass.class lives in,
This is crappy, but the only thing that worked.