Skip to content

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

Open

Description

@ProstoF

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.

Activity

  1. ProstoF commented on Dec 21, 2019

    @ProstoF
    Author

    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)
    
  2. ProstoF commented on Dec 22, 2019

    @ProstoF
    Author

    Devices:

    Screenshot 2019-12-22 14 45 22

    Screenshot 2019-12-22 14 45 31

  3. lwld commented on Feb 3, 2020

    @lwld

    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

  4. victorraft commented on Mar 16, 2020

    @victorraft

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

  5. dlukashev commented on Mar 22, 2020

    @dlukashev

    same issue

  6. tring-kavinraj commented on Mar 23, 2020

    @tring-kavinraj

    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.

  7. marcosalis commented on Mar 27, 2020

    @marcosalis

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

  8. ProstoF commented on Mar 27, 2020

    @ProstoF
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions