最近组件化开发,使用了google的注解@AutoService(),在手机上正常,在目标设备出错,空指针异常,排查原因发现两个只有manifest的sharedUserId的差别。再分析,log中有以下错误
ClassLoader.getResources: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());
AutoService的源码中也有ClassLoader的使用,问题应该就是这儿了
原因:
manifest.xml写了