Question

I am triying this code

https://github.com/headius/dexclient/blob/master/src/DexClient.java

And I have in my main code the following code:

DexClient dxclient = new DexClient();
String[] name = { "/mnt/sdcard/HelloWorld.class" };
try {
    byte[] mybytes = getBytesFromFile(new File(name[0]));
    byte[][] bytes = {mybytes};
    dxclient.classesToDex(name, bytes);
}
catch(Exception e) {
    e.printStackTrace();
}

My HelloWorld Class is the following:

package mnt.sdcard;

public class HelloWorld {

    private String message;

    public void setMessage(String message) {
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

}

But I have the next error:

WARN/System.err(298): com.android.dx.cf.iface.ParseException: 
    class name (mnt/sdcard/HelloWorld) does not match path 
    (/mnt/sdcard/HelloWorld.class)

Can someone help me?

Was it helpful?

Solution

I solve this problem

I changed this:

String[] name={"/mnt/sdcard/HelloWorld.class"};

to this

String[] name={"mnt/sdcard/HelloWorld.class"};

Thanks :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top