facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.28k stars 24.35k forks source link

React Native android app crashing with java.lang.UnsatisfiedLinkError: dlopen failed: library "libnative-imagetranscoder.so" not found when trying to load web jpg images #37180

Closed charlesBon closed 1 year ago

charlesBon commented 1 year ago

Description

App crashing with java.lang.UnsatisfiedLinkError: dlopen failed: library "libnative-imagetranscoder.so" not found when trying to load web jpg images

Using latest react-native-android 0.71.7, FATAL EXCEPTION: FrescoIoBoundExecutor-2 Process: com.myapp, PID: 21806 java.lang.UnsatisfiedLinkError: dlopen failed: library "libnative-imagetranscoder.so" not found at java.lang.Runtime.loadLibrary0(Runtime.java:1077) at java.lang.Runtime.loadLibrary0(Runtime.java:998) at java.lang.System.loadLibrary(System.java:1661) at com.facebook.soloader.nativeloader.SystemDelegate.loadLibrary(SystemDelegate.java:24) at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:52) at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:30) at com.facebook.imagepipeline.nativecode.NativeJpegTranscoderSoLoader.ensure(NativeJpegTranscoderSoLoader.java:33) at com.facebook.imagepipeline.nativecode.NativeJpegTranscoder.<init>(NativeJpegTranscoder.java:59) at com.facebook.imagepipeline.nativecode.NativeJpegTranscoderFactory.createImageTranscoder(NativeJpegTranscoderFactory.java:43) at com.facebook.imagepipeline.transcoder.MultiImageTranscoderFactory.getNativeImageTranscoder(MultiImageTranscoderFactory.kt:59) at com.facebook.imagepipeline.transcoder.MultiImageTranscoderFactory.createImageTranscoder(MultiImageTranscoderFactory.kt:40) at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.onNewResultImpl(ResizeAndRotateProducer.java:166) at com.facebook.imagepipeline.producers.ResizeAndRotateProducer$TransformingConsumer.onNewResultImpl(ResizeAndRotateProducer.java:84) at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult(BaseConsumer.java:89) at com.facebook.imagepipeline.producers.AddImageTransformMetaDataProducer$AddImageTransformMetaDataConsumer.onNewResultImpl(AddImageTransformMetaDataProducer.java:49) at com.facebook.imagepipeline.producers.AddImageTransformMetaDataProducer$AddImageTransformMetaDataConsumer.onNewResultImpl(AddImageTransformMetaDataProducer.java:33) at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult(BaseConsumer.java:89) at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer.onNextResult(MultiplexProducer.java:510) at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer$ForwardingConsumer.onNewResultImpl(MultiplexProducer.java:569) at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer$ForwardingConsumer.onNewResultImpl(MultiplexProducer.java:562) at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult(BaseConsumer.java:89) at com.facebook.imagepipeline.producers.EncodedMemoryCacheProducer$EncodedMemoryCacheConsumer.onNewResultImpl(EncodedMemoryCacheProducer.java:188) at com.facebook.imagepipeline.producers.EncodedMemoryCacheProducer$EncodedMemoryCacheConsumer.onNewResultImpl(EncodedMemoryCacheProducer.java:123) at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult(BaseConsumer.java:89) at com.facebook.imagepipeline.producers.DiskCacheReadProducer$1.then(DiskCacheReadProducer.java:113) at com.facebook.imagepipeline.producers.DiskCacheReadProducer$1.then(DiskCacheReadProducer.java:93) at bolts.Task$14.run(Task.java:872) at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105) at bolts.Task.completeImmediately(Task.java:863) at bolts.Task.access$000(Task.java:32) at bolts.Task$10.then(Task.java:654) at bolts.Task$10.then(Task.java:651) at bolts.Task.runContinuations(Task.java:956) at bolts.Task.trySetResult(Task.java:994) at bolts.TaskCompletionSource.trySetResult(TaskCompletionSource.java:39) at bolts.TaskCompletionSource.setResult(TaskCompletionSource.java:62) at bolts.Task$4.run(Task.java:357) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.facebook.imagepipeline.core.PriorityThreadFactory.newThread$lambda$0(PriorityThreadFactory.kt:37) at com.facebook.imagepipeline.core.PriorityThreadFactory.$r8$lambda$IPp7Vm9a1KDy8D4770JTjI9qOG4(Unknown Source:0) 2023-04-30 14:11:44.994 21806-21926 AndroidRuntime com.myapp E at com.facebook.imagepipeline.core.PriorityThreadFactory$$ExternalSyntheticLambda0.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:1012)

React Native Version

0.71.7

Output of npx react-native info

System: OS: macOS 13.3.1 CPU: (10) arm64 Apple M1 Pro Memory: 241.92 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.0.0 - /opt/homebrew/bin/node Yarn: Not Found npm: 7.7.5 Watchman: 2023.04.24.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: Not Found SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: Not Found IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9862592 Xcode: 14.3/14E222b - /usr/bin/xcodebuild Languages: Java: 11.0.19 - /usr/bin/javac npmPackages: @react-native-community/cli: 6.4.0 => 6.4.0 react: 18.2.0 => 18.2.0 react-native: 0.71.7 => 0.71.7 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Use React-Native 0.71.7

In android/app/build.grade add fresco for android image support implementation 'com.facebook.fresco:animated-gif:2.5.0' implementation 'com.facebook.fresco:animated-webp:2.5.0' implementation 'com.facebook.fresco:webpsupport:2.5.0'

In react native app use below to try and load images from the web or from an Api. <Image source={{uri: jpgWebUrlImage}} resizeMethod='resize' style={{resizeMode: 'contain', width: width, height:height, flex: 0 }} />

Snack, code example, screenshot, or link to a repository

<Image source={{uri: jpgWebUrlImage}} resizeMethod='resize' style={{resizeMode: 'contain', width: width, height:height, flex: 0 }} />

dylmye commented 1 year ago

@charlesBon how did you resolve this?

kibiz0r commented 1 year ago

@dylmye See https://github.com/facebook/fresco/issues/2722

cubuspl42 commented 1 year ago

I'm getting this in RNTester built from source on the newest main. Why is this issue closed? Am I doing something wrong?