java.lang.UnsatisfiedLinkError: Couldn’t load solibrary from loader dalvik.system.PathClassLoader: findLibrary returned null java.lang.UnsatisfiedLinkError: Library solibrary not found
final File workaroundFile = getWorkaroundLibFile(context, library, version); if (!workaroundFile.exists() || force) { if (force) { log("Forcing a re-link of %s (%s)...", library, version); }
try { //支持加载so的依赖 if (recursive) { final ElfParser parser = new ElfParser(workaroundFile); final List<String> dependencies = parser.parseNeededDependencies(); for (final String dependency : dependencies) { loadLibrary(context, libraryLoader.unmapLibraryName(dependency)); } } } catch (IOException ignored) { // This a redundant step of the process, if our library resolving fails, it will likely // be picked up by the system's resolver, if not, an exception will be thrown by the // next statement, so its better to try twice. }
//最后加载app-lib/下的so文件 libraryLoader.loadPath(workaroundFile.getAbsolutePath()); loadedLibraries.add(library); log("%s (%s) was re-linked!", library, version); }