messenger跨进程通信出现ClassNotFoundException...

利用messenger实现remote进程的service和主进程通信的时候报错com.xxx.xxx.xxx.bean.xxxbean on path: DexPathList[[directory .],nativeLibraryDirectories=[/vendor/lib, /data/cust/lib, /system/lib]]

看log发现错误处是在client解析从service发过来的message中的bundle对象,

网上搜了有人说是因为类加载器的问题,然后自己在   data.getParcelable(key);之前加一句 data.setClassLoader(getClass().getClassLoader()); 果然,问题解决了.

进程间通信果然到处是雷.

原文地址:https://www.cnblogs.com/xns1001/p/5214673.html