๋ก๋ํ DSO๋ฅผ ์ฐพ์ ์ ์์: libimagepipeline.so
com.facebook.soloader.SoLoader.void doLoadLibraryBySoName(java.lang.String,int,android.os.StrictMode$ThreadPolicy)...
03-23 โโ19:21:55.955 17814 17931 ์ ์ ์์ : dlopen("/data/data/xxx/lib-main/libimagepipeline.so", RTLD_LAZY) ์คํจ: dlopen ์คํจ: "/data/data/xxx/lib-main /libimagepipeline.so"๋ 32๋นํธ๊ฐ ์๋ 64๋นํธ์
๋๋ค.
03-23 โโ19:21:55.955 17814 17931 E SoLoader: ๋ก๋ํ ์ ์์: libimagepipeline.so
com.facebook.soloader.SoLoader.void doLoadLibraryBySoName(java.lang.String,int,android.os.StrictMode$ThreadPolicy)(SoLoader.java:522)
com.facebook.soloader.SoLoader.void loadLibraryBySoName(java.lang.String,java.lang.String,java.lang.String,int,android.os.StrictMode$ThreadPolicy)(SoLoader.java:420)
com.facebook.soloader.SoLoader.void loadLibrary(java.lang.String,int)(SoLoader.java:370)
com.facebook.soloader.SoLoader.void loadLibrary(java.lang.String)(SoLoader.java:335)
com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.void load()(ImagePipelineNativeLoader.java:42)
com.facebook.imagepipeline.memory.NativeMemoryChunk.void
com.facebook.imagepipeline.memory.NativeMemoryChunkPool.com.facebook.imagepipeline.memory.NativeMemoryChunk alloc(int)(NativeMemoryChunkPool.java:58)
com.facebook.imagepipeline.memory.NativeMemoryChunkPool.void free(java.lang.Object)(NativeMemoryChunkPool.java:20)
com.facebook.imagepipeline.memory.BasePool.java.lang.Object get(int)(BasePool.java:257)
com.facebook.imagepipeline.memory.NativePooledByteBufferOutputStream.void
com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.com.facebook.imagepipeline.memory.NativePooledByteBuffer newByteBuffer(java.io.InputStream,int)(NativePooledByteBufferFactory.java:98)
com.facebook.imagepipeline.memory.NativePooledByteBufferFactory.com.facebook.common.memory.PooledByteBufferOutputStream newOutputStream(int)(NativePooledByteBufferFactory.java:26)
com.facebook.imagepipeline.producers.LocalFetchProducer.com.facebook.imagepipeline.image.EncodedImage getByteBufferBackedEncodedImage(java.io.InputStream,int)(LocalFetchProducer.java:89)
com.facebook.imagepipeline.producers.LocalFetchProducer.com.facebook.imagepipeline.image.EncodedImage getEncodedImage(java.io.InputStream,int)(LocalFetchProducer.java:101)
com.facebook.imagepipeline.producers.LocalFileFetchProducer.com.facebook.imagepipeline.image.EncodedImage getEncodedImage(com.facebook.imagepipeline.request.ImageRequest)(LocalFileFetchProducer.java:34)
com.facebook.imagepipeline.producers.LocalFetchProducer$1.com.facebook.imagepipeline.image.EncodedImage getResult()(LocalFetchProducer.java:54)
com.facebook.imagepipeline.producers.LocalFetchProducer$1.java.lang.Object getResult()(LocalFetchProducer.java:50)
com.facebook.common.executors.StatefulRunnable.void run()(StatefulRunnable.java:45)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
com.facebook.imagepipeline.core.PriorityThreadFactory$1.void run()(PriorityThreadFactory.java:53)
java.lang.Thread.run(Thread.java:818)
https://github.com/facebook/fresco/issues/2049์ ์ค๋ณต ๊ฐ๋ฅ์ฑ์ด
์, ์ด๊ฒ์ #2049(ํนํ https://github.com/facebook/fresco/issues/2049#issuecomment-367235216)์ ๋ณต์ ๋ณธ์ธ ๊ฒ ๊ฐ์ต๋๋ค. @jyh149129 , ํ ๋ก ์ ์ง์คํ๊ธฐ ์ํด ์ฌ๊ธฐ์ ๋ฌธ์ ๋ฅผ ์ข ๋ฃํฉ๋๋ค. :)
@gengjiawen ๊ฐ์ฌํฉ๋๋ค!
๋ฐ์ ์ฟ๋จน์ด
ํด๊ฒฐ์ฑ ์ ์ด๋์ ์์ต๋๊น? Fresco ์ข ์์ฑ์ 1.13.0 ๋ฒ์ ์์ ๋ฌธ์ ์ ์ง๋ฉดํ๊ณ ์์ต๋๋ค. ๋์์ฃผ์ธ์.
/data/data/yourpackage/lib์ /data/data/yourpackage/lib-main์ cpu_abi๊ฐ ๋ค๋ฅด๊ธฐ ๋๋ฌธ์ ์ด ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ ์ด์ ๋ฅผ ์ฐพ์ ๊ฒ ๊ฐ์ต๋๋ค.
๊ทธ๋ฆฌ๊ณ ์ ๋ค๋ฅธ๊ฐ์? ExtractFromZipSoSource.ensureDsos()์ ๊ฒฐํจ์ด ์๊ธฐ ๋๋ฌธ์
๋๋ค.
์ด๋ค ๊ฒฐํจ? 32๋นํธ ๋ฐ 64๋นํธ so ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ๋ชจ๋ ์์ ๋ Android OS๋ ์ฌ์ฉ์๋ฅผ 64๋นํธ ์ฑ์ผ๋ก ์๊ฐํ๋ค๋ ๊ฐ์ ์ด ์์์ต๋๋ค. ๊ทธ๋ฌ๋ OPPO R7sm(Android 5.1.1 ColorOS: V3.0_170510_beta)์์ ๊ท์น์ด ๊นจ์ก์ต๋๋ค.
์ฝ๋๋ฅผ ์์ ํ์ฌ OPPO์ ๋ฒ๊ทธ๋ฅผ ์์ ํ์ต๋๋ค. ๋์ค์ ํ ๋ฆฌํ์คํธ๋ฅผ ํ์ฌ ์ฌ๋ฌ๋ถ์ ๋์์ ๊ธฐ๋ํ๊ฒ ์ต๋๋ค.
๊ต์ฅํฉ๋๋ค. @artemisia๋ฅผ ์กฐ์ฌํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค!
@artemisia ๋น์ ์ PR์ ๋ณด๊ณ
์ฃ์กํฉ๋๋ค, ์ ์์ด๊ฐ ์ข์ง ์์ต๋๋ค.
์ฅ์น: ๋ชจ๋ฐ์ผ ์ฅ์น: OPPC R7sm(AndroLinkid 5.1.1)
๊ฒฐ๊ณผ:
apk์ armeabi-v7a nad arm64-v8a๊ฐ ์๋ ๊ฒฝ์ฐ ์ผ๋ฐ์ ์ผ๋ก arm64-v8a๊ฐ ๋ก๋๋ฉ๋๋ค. ๊ทธ๋ฌ๋ OPPO R7sm์๋ armeabi-v7a๊ฐ ๋ก๋๋ฉ๋๋ค.
๊ฒฝ๋ก ๋ฐ์ดํฐ/์ฑ/์ ํ์ธํฉ๋๋ค.
soloader๋ฅผ ์ด๊ธฐํํ ๋ data/app/์ ์์ถ์ ํ๋๋ค.
ํ์ผ์ด ๋์ผํ์ง ์์ต๋๋ค. ๋ฐ์ดํฐ/๋ฐ์ดํฐ/์ ๋ณต์ฌํฉ๋๋ค.
์ง์ ๋ฐ๊ธฐAbis๋ ["arm64-v8a", "armeabi-v7a", "armeabi"]์
๋๋ค. *.so ํ์ผ์ ์์ฐจ์ ์ผ๋ก ํ์ธํฉ๋๋ค.
๊ทธ๋ฌ๋ data/app//lib/๋ OPPC R7sm์ arm์ด๋ฏ๋ก ํญ์ arm64-v8a os ํ์ผ์ data/data/์ ๋ณต์ฌํ์ญ์์ค.
Lead to *.so๋ 32๋นํธ ๋ฌธ์ ๊ฐ ์๋ 64๋นํธ ๋ฌธ์ ์ ๋๋ค.
๋ด ์๋ฃจ์ :
SoLoader ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์์ ํฉ๋๋ค. ์ฒดํฌ ๋ฐ์ดํฐ/์ฑ/์ถ๊ฐ
ํ์ผ:
ExtractFromZipSoSource.java
...
final ZipDso[] ensureDsos() {
if (mDsos == null) {
Set<String> librariesAbiSet = new LinkedHashSet<>();
HashMap<String, ZipDso> providedLibraries = new HashMap<>();
Pattern zipSearchPattern = Pattern.compile(mZipSearchPattern);
String[] supportedAbis = SysUtil.getSupportedAbis();
Enumeration<? extends ZipEntry> entries = mZipFile.entries();
+ // Fixed couldn't find DSO to load: "xxx.os" is 64-bit instead of 32-bit
+ File sysLibPath = new File(mContext.getApplicationInfo().nativeLibraryDir);
+ String sysLibAbi = sysLibPath.getPath().substring(sysLibPath.getPath().lastIndexOf("/")+1);
+ if(sysLibAbi.equalsIgnoreCase("arm")) {
+ // sys lib is load armeabi-v7a, this exception case
+ ArrayList<String> newSupportedAbis = new ArrayList();
+ for(String abi : supportedAbis) {
+ if(abi.equalsIgnoreCase("arm64-v8a")) {
+ //skip arm64-v8a
+ continue;
+ }
+
+ newSupportedAbis.add(abi);
+ }
+
+ supportedAbis = newSupportedAbis.toArray(new String[newSupportedAbis.size()]);
+ }
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
Matcher m = zipSearchPattern.matcher(entry.getName());
...
๋ฐ์ ์ฟ๋จน์ด
Flutter๋ฅผ ํ์ํฉ๋๋ค
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ฐ์ ์ฟ๋จน์ด