Android 开发: InMemoryDexClassLoader 加载 DEX 文件时调用 Native 方法报错 UnsatisfiedLinkError 解决方法
是的,加载 dex 文件时,如果其中使用了 native 方法,需要确保对应的 so 文件也被加载进来。InMemoryDexClassLoader 初始化时,可以通过传递 so 文件路径的方式来加载 so 文件。如果没有传递 so 文件路径,可能会导致找不到对应的 native 方法的实现,从而抛出 UnsatisfiedLinkError 异常。\n\n你可以尝试在初始化 InMemoryDexClassLoader 时传递 so 文件路径,确保 so 文件被正确加载进来,从而解决该异常。
原文地址: https://www.cveoy.top/t/topic/qaz5 著作权归作者所有。请勿转载和采集!