문제

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?

도움이 되었습니까?

해결책

I solve this problem

I changed this:

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

to this

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

Thanks :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top