compat android 5.x arm64 native lib path too long #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题描述:
加载绝对路径超过
128
字符的native库会报如下异常复现步骤:
native
测试模块中,hello-jni.so
名字改长一些,例如helloooooooooooooooooooooooooo-jni.so
,让整个路径超过128
个字符,例如/data/user/0/com.iqiyi.qigsaw.sample/app_qigsaw/1.0.0_ae5f1c9/native/1.0@1/nativeLib/arm64-v8a/libhelloooooooooooooooooooooooooo-jni.so
native
插件,会抛出UnsatisfiedLinkError
解决方案:
nativeLibPath
之前检测是否要进行路径映射5.x
) && (64位
) && (so文件绝对路径长度 >= 128
)才进行路径映射Os.symlink
将长路径映射到common_so
目录下,以缩短路径