我的应用程序崩溃了,在日志中我看到了:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/pl.pgo-1/base.apk"],nativeLibraryDirectories=[/data/app/pl.eltegps.pgo-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libpackage.so"
在这行中我的apk崩溃了:
System.loadLibrary("package");
这是我的全班
public class serial_native {
private int fd;
private int delay = 100;
private static final String TAG = "serial_native";
public int OpenComPort(String device)
{
fd = openport(device);
if (fd < 0) {
Log.e(TAG, "native open returns null");
return -1;
}
return 0;
}
public void CloseComPort()
{
closeport(fd);
}
public byte[] ReadPort(int count)
{
return readport(fd, count, delay);
}
public int WritePort(byte[] buf)
{
return writeport(fd, buf);
}
public void ClearBuffer()
{
clearportbuf(fd);
}
private native int openport(String port); //open serial port
private native void closeport(int fd); //close serial port
private native byte[] readport(int fd, int count, int delay); //try to read number of count bytes, then return a byte array, which may be shorter than count
private native int writeport(int fd, byte[] buf); //try to write byte array to serialport, may be failed
private native void clearportbuf(int fd); //clear the serialport read/write buffer
public static boolean libsLoaded = false;
public static String libsLoadException = null;
static {
try {
System.loadLibrary("package");
System.loadLibrary("lfrfid");
libsLoaded = true;
}
catch (Exception e) {
libsLoaded = false;
libsLoadException = e.getMessage();
}
}
}