Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WrongAbiError: APK was built for a different platform, fresco 2.1.0 #56

Open
ProstoF opened this issue Dec 21, 2019 · 8 comments
Open

Comments

@ProstoF
Copy link

ProstoF commented Dec 21, 2019

Description

#39
After updating to fresco:2.1.0 we still have crashes:

Fatal Exception: com.facebook.soloader.SoLoader$WrongAbiError: APK was built for a different platform
       at com.facebook.soloader.SoLoader.loadLibraryBySoName + 645(SoLoader.java:645)
       at com.facebook.soloader.SoLoader.loadLibrary + 577(SoLoader.java:577)
       at com.facebook.soloader.SoLoader.loadLibrary + 525(SoLoader.java:525)
       at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary + 24(NativeLoaderToSoLoaderDelegate.java:24)
       at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary + 43(NativeLoader.java:43)
       at com.facebook.imagepipeline.memory.NativeMemoryChunk.<clinit> + 31(NativeMemoryChunk.java:31)
       at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc + 29(NativeMemoryChunkPool.java:29)
       at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc + 15(NativeMemoryChunkPool.java:15)
       at com.facebook.imagepipeline.memory.BasePool.get + 243(BasePool.java:243)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.<init> + 51(MemoryPooledByteBufferOutputStream.java:51)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer + 73(MemoryPooledByteBufferFactory.java:73)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer + 24(MemoryPooledByteBufferFactory.java:24)
       at com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage + 78(LocalFetchProducer.java:78)
       at com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage + 88(LocalFetchProducer.java:88)
       at com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage + 33(LocalResourceFetchProducer.java:33)
       at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult + 44(LocalFetchProducer.java:44)
       at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult + 40(LocalFetchProducer.java:40)
       at com.facebook.common.executors.StatefulRunnable.run + 43(StatefulRunnable.java:43)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1112(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 587(ThreadPoolExecutor.java:587)
       at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run + 50(PriorityThreadFactory.java:50)
       at java.lang.Thread.run + 818(Thread.java:818)
Caused by java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so caused by: dlopen failed: "/data/data/ru.app/lib-main/libimagepipeline.so" has unexpected e_machine: 40
       at com.facebook.soloader.SoLoader.doLoadLibraryBySoName + 789(SoLoader.java:789)
       at com.facebook.soloader.SoLoader.loadLibraryBySoName + 639(SoLoader.java:639)
       at com.facebook.soloader.SoLoader.loadLibrary + 577(SoLoader.java:577)
       at com.facebook.soloader.SoLoader.loadLibrary + 525(SoLoader.java:525)
       at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary + 24(NativeLoaderToSoLoaderDelegate.java:24)
       at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary + 43(NativeLoader.java:43)
       at com.facebook.imagepipeline.memory.NativeMemoryChunk.<clinit> + 31(NativeMemoryChunk.java:31)
       at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc + 29(NativeMemoryChunkPool.java:29)
       at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc + 15(NativeMemoryChunkPool.java:15)
       at com.facebook.imagepipeline.memory.BasePool.get + 243(BasePool.java:243)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.<init> + 51(MemoryPooledByteBufferOutputStream.java:51)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer + 73(MemoryPooledByteBufferFactory.java:73)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer + 24(MemoryPooledByteBufferFactory.java:24)
       at com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage + 78(LocalFetchProducer.java:78)
       at com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage + 88(LocalFetchProducer.java:88)
       at com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage + 33(LocalResourceFetchProducer.java:33)
       at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult + 44(LocalFetchProducer.java:44)
       at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult + 40(LocalFetchProducer.java:40)
       at com.facebook.common.executors.StatefulRunnable.run + 43(StatefulRunnable.java:43)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1112(ThreadPoolExecutor.java:1112)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 587(ThreadPoolExecutor.java:587)
       at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run + 50(PriorityThreadFactory.java:50)
       at java.lang.Thread.run + 818(Thread.java:818)

Application.java

OkHttpClient.Builder ohcb = new OkHttpClient.Builder()
                .proxy(Proxy.NO_PROXY)
                .connectTimeout(20, TimeUnit.SECONDS)
                .readTimeout(20, TimeUnit.SECONDS)
                .writeTimeout(20, TimeUnit.SECONDS)
                .addInterceptor(new Interceptor() {
                    @Override
                    public Response intercept(Chain chain) throws IOException {
                        Request.Builder ongoing = chain.request().newBuilder();
                        ongoing.addHeader("X-device", "android");
                        // etc..
                        return chain.proceed(ongoing.build());
                    }
                });

        ImagePipelineConfig imagePipelineConfig = OkHttpImagePipelineConfigFactory
                .newBuilder(this, ohcb.build())
                .build();
        Fresco.initialize(this, imagePipelineConfig);

Reproduction

I can't reproduce this crash on all my devices and emulators.

Additional Information

  • Fresco version: 2.1.0
  • imagepipeline-okhttp3: 2.1.0
  • androidx
  • we use apk, NOT bundle

For now, we have only several crashes, all of this on ASUS ZenFone 2 (ZE551ML)
Android 6.0.1, Android 5.0
I will add more information about devices when it appears.

@ProstoF
Copy link
Author

ProstoF commented Dec 21, 2019

Not immediately noticed there is another crash with the same amount, and also only this device ASUS ZenFone 2 (ZE551ML)

Fatal Exception: java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.imagepipeline.memory.NativeMemoryChunk; see exception in other thread
       at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc + 29(NativeMemoryChunkPool.java:29)
       at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc + 15(NativeMemoryChunkPool.java:15)
       at com.facebook.imagepipeline.memory.BasePool.get + 243(BasePool.java:243)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.<init> + 51(MemoryPooledByteBufferOutputStream.java:51)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer + 73(MemoryPooledByteBufferFactory.java:73)
       at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer + 24(MemoryPooledByteBufferFactory.java:24)
       at com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage + 78(LocalFetchProducer.java:78)
       at com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage + 88(LocalFetchProducer.java:88)
       at com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage + 33(LocalResourceFetchProducer.java:33)
       at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult + 44(LocalFetchProducer.java:44)
       at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult + 40(LocalFetchProducer.java:40)
       at com.facebook.common.executors.StatefulRunnable.run + 43(StatefulRunnable.java:43)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1113(ThreadPoolExecutor.java:1113)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 588(ThreadPoolExecutor.java:588)
       at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run + 50(PriorityThreadFactory.java:50)
       at java.lang.Thread.run + 818(Thread.java:818)

@ProstoF
Copy link
Author

ProstoF commented Dec 22, 2019

Devices:

Screenshot 2019-12-22 14 45 22

Screenshot 2019-12-22 14 45 31

@lwld
Copy link

lwld commented Feb 3, 2020

We also get this on several devices:

  • LENOVO (P851X, various YOGA Book/Tablets)
  • Google Chromebook R11 (C738T)
  • inaviTab (ITP-XD10S)
  • asus ZenFone 2 (ZE551ML)
    All on Android 5-7.

We also have a potentially related Exception on

  • Google Intel Apollo Lake Chromebook (Android 9)
Fatal Exception: java.lang.NoClassDefFoundError in com.facebook.imagepipeline.memory.NativeMemoryChunk
Caused by com.facebook.soloader.SoLoader$a: APK was built for a different platform

And we also get the "see exception in other thread" crash, on the same devices

Fatal Exception: java.lang.NoClassDefFoundError: <clinit> failed for class com.facebook.imagepipeline.memory.NativeMemoryChunk; see exception in other thread

Can provide full stack traces if helpful.

Happens in Fresco 2.1.0, didn't happen before in Fresco 2.0.0

@victorraft
Copy link

Same situation here. Getting these crashes after updating to 2.1.0.

@dlukashev
Copy link

same issue

@kavinTring
Copy link

Fatal Exception: com.facebook.soloader.SoLoader$WrongAbiError: APK was built for a different platform
at com.facebook.soloader.SoLoader.loadLibraryBySoName + 645(SoLoader.java:645)
at com.facebook.soloader.SoLoader.loadLibrary + 577(SoLoader.java:577)
at com.facebook.soloader.SoLoader.loadLibrary + 525(SoLoader.java:525)
at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary + 24(NativeLoaderToSoLoaderDelegate.java:24)
at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary + 43(NativeLoader.java:43)
at com.facebook.imagepipeline.memory.NativeMemoryChunk. + 31(NativeMemoryChunk.java:31)
at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc + 29(NativeMemoryChunkPool.java:29)
at com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc + 15(NativeMemoryChunkPool.java:15)
at com.facebook.imagepipeline.memory.BasePool.get + 243(BasePool.java:243)
at com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream. + 51(MemoryPooledByteBufferOutputStream.java:51)
at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer + 73(MemoryPooledByteBufferFactory.java:73)
at com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer + 24(MemoryPooledByteBufferFactory.java:24)
at com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage + 78(LocalFetchProducer.java:78)
at com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage + 88(LocalFetchProducer.java:88)
at com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage + 33(LocalResourceFetchProducer.java:33)
at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult + 44(LocalFetchProducer.java:44)
at com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult + 40(LocalFetchProducer.java:40)
at com.facebook.common.executors.StatefulRunnable.run + 43(StatefulRunnable.java:43)
at java.util.concurrent.ThreadPoolExecutor.runWorker + 1167(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run + 641(ThreadPoolExecutor.java:641)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run + 50(PriorityThreadFactory.java:50)
at java.lang.Thread.run + 764(Thread.java:764)

I am using Fresco animated gif version(2.1.0) in my project. Before this version we are using 2.0.0 in that we are not seeing any kind of crashes. I think they have made change in soloader class. It might be the reason for the issue. Please share if any solution to resolve the issue.

@marcosalis
Copy link

We are having the same issue with Fresco 2.1.0 on a Chromebook Pixel (2015), any updates? 🙏

@ProstoF
Copy link
Author

ProstoF commented Mar 27, 2020

We have solved this issue by removing SoLoader from Fresco lib

implementation('com.facebook.fresco:fresco:2.1.0') {
        exclude group: 'com.facebook.soloader', module: 'soloader'
        exclude group: 'com.facebook.fresco', module: 'soloader'
    }

https://frescolib.org/docs/#5-optional-setting-a-non-default-native-library-loader-only-for-fresco-21-and-above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants