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

App Crash on Android OS 5.1.1 Real Oppo R7s (32BIT) RN(0.60.0) #25490

Closed
xrebrovz opened this issue Jul 4, 2019 · 32 comments
Closed

App Crash on Android OS 5.1.1 Real Oppo R7s (32BIT) RN(0.60.0) #25490

xrebrovz opened this issue Jul 4, 2019 · 32 comments
Labels
Bug Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@xrebrovz
Copy link

xrebrovz commented Jul 4, 2019

after init react native new version 0.60.0 application crash after open

07-04 16:42:16.737 30259-30317/? E/art: dlopen("/data/data/com.news060/lib-main/libc++_shared.so", RTLD_LAZY) failed: dlopen failed: "/data/data/com.news060/lib-main/libc++_shared.so" is 64-bit instead of 32-bit
07-04 16:42:16.737 30259-30317/? E/SoLoader: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.news060/lib-main/libc++_shared.so" is 64-bit instead of 32-bit
07-04 16:42:16.737 30259-30317/? E/SoLoader: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.news060/lib-main/libc++_shared.so" is 64-bit instead of 32-bit
07-04 16:42:16.737 30259-30317/? E/SoLoader: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.news060/lib-main/libc++_shared.so" is 64-bit instead of 32-bit
07-04 16:42:16.737 30259-30317/? E/SoLoader: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.news060/lib-main/libc++_shared.so" is 64-bit instead of 32-bit

FATAL EXCEPTION: create_react_context
Process: com.news060, PID: 30259
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libglog_init.so caused by: couldn't find DSO to load: libglog.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.news060/lib-main/libc++_shared.so" is 64-bit instead of 32-bit
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
at com.facebook.react.bridge.ReactBridge.staticInit(ReactBridge.java:31)
at com.facebook.react.bridge.NativeMap.(NativeMap.java:19)
at com.facebook.react.jscexecutor.JSCExecutorFactory.create(JSCExecutorFactory.java:25)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:949)
at java.lang.Thread.run(Thread.java:818)

Environment:

React Native Version 0.60.0
OS: Mac OS Mojave 10.14.4
Android Studio: Version 3.4.1
Android Device Oppo r7s 5.1.1 (os 32bit)

Steps To Reproduce

1.Init React Native 0.60.0
2.react-native run-android on real device oppo r7s 5.1.1 (os 32bit) app crash

@xrebrovz xrebrovz added the Bug label Jul 4, 2019
@react-native-bot react-native-bot added the Platform: Android Android applications. label Jul 4, 2019
@reachzhai
Copy link

reachzhai commented Jul 23, 2019

same problem,so many users tell us they can't use our app

java.lang.UnsatisfiedLinkError: at com.facebook.soloader.SoLoader.b (SoLoader.java:738) at com.facebook.soloader.SoLoader.a (SoLoader.java:591) at com.facebook.soloader.SoLoader.a (SoLoader.java:529) at com.facebook.soloader.SoLoader.a (SoLoader.java:484) at com.facebook.react.bridge.ReactBridge.staticInit (ReactBridge.java:31) at com.facebook.react.bridge.NativeMap.<clinit> (NativeMap.java:19) at com.facebook.react.jscexecutor.JSCExecutorFactory.create (JSCExecutorFactory.java:25) at com.facebook.react.ReactInstanceManager$5.run (ReactInstanceManager.java:944) at java.lang.Thread.run (Thread.java:818)

@ckitterl
Copy link

ckitterl commented Jul 25, 2019

The problem is caused by OPPP's install application.
Please check your application's 64bit so files, if the count of 64bit so files less than 32bit so files?
If so, OPPO install application will put 32bit so files instead of 64bit so files to libs which is used by System.loadLibrary(...) . But react-native use soload library, which will unzip 64bit so file to folder named lib-main when Soload.init() invoked. And load the 64bit so files.

You have to added the short of 64bit so files to come across the problem

@BennyTian
Copy link

the same problem .

couldn't find DSO to load: libreactnativejni.so caused by: couldn't find DSO to load: libfb.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: "/data/data/com.huabenapp/lib-main/libc++_shared.so" is 64-bit instead of 32-bit

crash on Android 5.0/5.1/5.1.1 device.

@ckitterl
Copy link

ckitterl commented Aug 9, 2019

@BennyTian If my answer can't resolve the problem ?

@BennyTian
Copy link

@BennyTian If my answer can't resolve the problem ?

I am going to try thanks .

@zsajjad
Copy link

zsajjad commented Aug 9, 2019

Facing same issue. Count of 64bit & 32bit libs is same @ckitterl

@codyi96
Copy link
Contributor

codyi96 commented Aug 14, 2019

Same issue in VIVO X7...
It seems a bug caused by the installer of Funtouch OS. I update to Funtouch OS PD1602_A_3.12.2 then it works. 😎

@ckitterl
Copy link

@zsajjad VIVO or OPPO. I test on OPPO R9 with colorOS v3.0.0 and android 5.1; If the count of 64bit & 32bit libs are same, everything is OK. But Failed with VIVO X7 as codyi96 said

@zsajjad
Copy link

zsajjad commented Aug 14, 2019

I made changes to packagingOptions and things are working fine on all devices both 64-bit & 32 bit devices

    defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        }
    }
    ...
    packagingOptions {
        doNotStrip '*/mips/*.so'
        doNotStrip '*/mips64/*.so'
        pickFirst '**/armeabi-v7a/libc++_shared.so'
        pickFirst '**/x86/libc++_shared.so'
        pickFirst '**/arm64-v8a/libc++_shared.so'
        pickFirst '**/x86_64/libc++_shared.so'

        pickFirst '**/x86/libjsc.so'
        pickFirst '**/armeabi-v7a/libjsc.so'

        exclude "lib/arm64-v8a/libgnustl_shared.so"
        exclude '/lib/mips64/**'
        exclude '/lib/arm64-v8a/**'
        exclude '/lib/x86_64/**'
    }

@codyi96
Copy link
Contributor

codyi96 commented Aug 15, 2019

I made changes to packagingOptions and things are working fine on all devices both 64-bit & 32 bit devices

    defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        }
    }
    ...
    packagingOptions {
        doNotStrip '*/mips/*.so'
        doNotStrip '*/mips64/*.so'
        pickFirst '**/armeabi-v7a/libc++_shared.so'
        pickFirst '**/x86/libc++_shared.so'
        pickFirst '**/arm64-v8a/libc++_shared.so'
        pickFirst '**/x86_64/libc++_shared.so'

        pickFirst '**/x86/libjsc.so'
        pickFirst '**/armeabi-v7a/libjsc.so'

        exclude "lib/arm64-v8a/libgnustl_shared.so"
        exclude '/lib/mips64/**'
        exclude '/lib/arm64-v8a/**'
        exclude '/lib/x86_64/**'
    }

Thank you for your reply! But I have different opinions.
It's impossiable to generate an apk file included .so files for arm64-v8a i think. Because you has excluded /lib/arm64-v8a/**.
In other words, the following configuration is invalid:

     defaultConfig {
         ndk {
             abiFilters 'arm64-v8a'
         }
     }

In this case, you only used .so files for armeabi-v7a instead of arm64-v8a, so it works.😂
@zsajjad

codyi96 added a commit to codyi96/SoLoader that referenced this issue Aug 20, 2019
Fixed: facebook/react-native#25490
Make extraction strategy of .so files smarter. In past versions,
SoLoader follows standard rule to extract .so files from zip.
However, some phones customize application installer which doesn't
follow standard rule. And then, may cause crash because .so files
of different ABI is loaded in the application. But now, SoLoader
will parse .so files in lib dir to determine which ABI should be
extracted. It can ensure that only one type of ABI will be loaded in
the application so that SoLoader can be adapted for more models.
@waseefakhtar
Copy link

waseefakhtar commented Aug 20, 2019

I made changes to packagingOptions and things are working fine on all devices both 64-bit & 32 bit devices

    defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        }
    }
    ...
    packagingOptions {
        doNotStrip '*/mips/*.so'
        doNotStrip '*/mips64/*.so'
        pickFirst '**/armeabi-v7a/libc++_shared.so'
        pickFirst '**/x86/libc++_shared.so'
        pickFirst '**/arm64-v8a/libc++_shared.so'
        pickFirst '**/x86_64/libc++_shared.so'

        pickFirst '**/x86/libjsc.so'
        pickFirst '**/armeabi-v7a/libjsc.so'

        exclude "lib/arm64-v8a/libgnustl_shared.so"
        exclude '/lib/mips64/**'
        exclude '/lib/arm64-v8a/**'
        exclude '/lib/x86_64/**'
    }

@zsajjad I tried your suggestion by making changes to packagingOptions which now throws an exception saying /libimagepipeline.so" is 32-bit instead of 64-bit instead of the other way around (I mean, I can reproduce it even on an emulator and not just on an Oppo device):

2019-08-20 15:40:03.430 14786-15049/com.degoo.android.dev W/System.err: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libimagepipeline.so caused by: dlopen failed: "/data/data/com.degoo.android.dev/lib-main/libimagepipeline.so" is 32-bit instead of 64-bit com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738) 
com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591) 
com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529) 
com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484) 
com.facebook.imagepipeline.nativecode.ImagePipelineNativeLoader.load(ImagePipelineNativeLoader.java:40) 
com.facebook.imagepipeline.memory.NativeMemoryChunk.<clinit>(NativeMemoryChunk.java:31
com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:25)
com.facebook.imagepipeline.memory.NativeMemoryChunkPool.alloc(NativeMemoryChunkPool.java:13) 
com.facebook.imagepipeline.memory.BasePool.get(BasePool.java:267)
com.facebook.imagepipeline.memory.MemoryPooledByteBufferOutputStream.<init (MemoryPooledByteBufferOutputStream.java:51) com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer(MemoryPooledByteBufferFactory.java:73) 
com.facebook.imagepipeline.memory.MemoryPooledByteBufferFactory.newByteBuffer(MemoryPooledByteBufferFactory.java:24) 
com.facebook.imagepipeline.producers.LocalFetchProducer.getByteBufferBackedEncodedImage(LocalFetchProducer.java:85) 
com.facebook.imagepipeline.producers.LocalFetchProducer.getEncodedImage(LocalFetchProducer.java:97) 
com.facebook.imagepipeline.producers.LocalResourceFetchProducer.getEncodedImage(LocalResourceFetchProducer.java:37) 
com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:50) com.facebook.imagepipeline.producers.LocalFetchProducer$1.getResult(LocalFetchProducer.java:46) 
com.facebook.common.executors.StatefulRunnable.run(StatefulRunnable.java:43) 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:51) java.lang.Thread.run(Thread.java:919)

Any idea why's that so?

@codyi96
Copy link
Contributor

codyi96 commented Aug 20, 2019

Fixed by this pr.

@waseefakhtar
Copy link

waseefakhtar commented Aug 21, 2019

@oprisnik could you merge @codyi96's PR and release a new version for Fresco?

@oprisnik
Copy link
Contributor

Awesome, thanks @codyi96, I'll take a look.

codyi96 added a commit to codyi96/SoLoader that referenced this issue Aug 28, 2019
Fixed: facebook/react-native#25490
Make extraction strategy of .so files smarter. In past versions,
SoLoader follows standard rule to extract .so files from zip.
However, some phones customize application installer which doesn't
follow standard rule. It may cause crash because .so files of
different ABI is loaded in the application. In order to deal with
this problem, SoLoader will parse current process path to determine
which ABI should be extracted. It'll ensure that only one type
of ABI will be loaded in the application so that SoLoader can be
adapted for more models.
codyi96 added a commit to codyi96/SoLoader that referenced this issue Aug 28, 2019
Fixed: facebook/react-native#25490
Make extraction strategy of .so files smarter. In past versions,
SoLoader follows standard rule to extract .so files from zip.
However, some phones customize application installer which doesn't
follow standard rule. It may cause crash because .so files of
different ABI is loaded in the application. In order to deal with
this problem, SoLoader will parse current process path to determine
which ABI should be extracted. It'll ensure that only one type
of ABI will be loaded in the application so that SoLoader can be
adapted for more models.
codyi96 added a commit to codyi96/SoLoader that referenced this issue Aug 28, 2019
Fixed: facebook/react-native#25490
Make extraction strategy of .so files smarter. In past versions,
SoLoader follows standard rule to extract .so files from zip.
However, some phones customize application installer which doesn't
follow standard rule. It may cause crash because .so files of
different ABIs are loaded in the application. In order to deal with
this problem, SoLoader will parse the path of current process to
determine which ABI should be extracted. It'll ensure that only
one type of ABI will be loaded in the application so that
SoLoader can be adapted for more models.
facebook-github-bot pushed a commit to facebook/SoLoader that referenced this issue Sep 4, 2019
Summary:
fix [bug](facebook/react-native#25490).

Make extraction strategy of .so files smarter.
In past versions, SoLoader follows standard rule to extract .so files from zip. However, some phones customize application installer which doesn't follow standard rule. And then, may cause crash because .so files of different ABI is loaded in the application.
In this version, SoLoader will parse .so files in lib dir to determine which ABI of .so files should be extracted to lib-main dir. It can ensure that only one type of ABI will be loaded in the application so that SoLoader can be adapted for more models.
Pull Request resolved: #45

Reviewed By: BurntBrunch

Differential Revision: D16939437

Pulled By: oprisnik

fbshipit-source-id: de4211ddcf71cedb4654a7d857ea2fbe818e021d
@oprisnik
Copy link
Contributor

SoLoader 0.8.0 has been released. You can now update the version for RN and this should be fixed, fingers crossed.

Side note: With v0.8.0, we've also released a new NativeLoader interface that can be used instead of SoLoader.loadLibrary(...). This allows you to employ any native library loading mechanism you'd like. Just implement your own NativeLoaderDelegate and initialize NativeLoader with that instance.

@btxd
Copy link

btxd commented Sep 24, 2019

Hi,guys.I have given up using fresco. Facebook developer solves the problem too slowly; use Glide to solve my problem

@auchaphon
Copy link

react-native v0.60.5
still issue please help me

@ckitterl
Copy link

ckitterl commented Sep 24, 2019

react-native v0.60.5
still issue please help me

@auchaphon Upgrade Soloader 0.80 will resolve your problem.

@auchaphon
Copy link

react-native v0.60.5
still issue please help me

@auchaphon Upgrade Soloader 0.80 will resolve your problem.

how to upgrade in react-native , please

@auchaphon
Copy link

react-native v0.60.5
still issue please help me

@auchaphon Upgrade Soloader 0.80 will resolve your problem.

I try this , still not work
Screen Shot 2562-09-24 at 20 30 53

@codyi96
Copy link
Contributor

codyi96 commented Sep 24, 2019

react-native v0.60.5
still issue please help me

@auchaphon Upgrade Soloader 0.80 will resolve your problem.

I try this , still not work
Screen Shot 2562-09-24 at 20 30 53

@auchaphon
You can try to do it like this:

configurations.all {
     resolutionStrategy {
       force "com.facebook.soloader:soloader:0.8.0"
     }
}

@ursnj
Copy link

ursnj commented Sep 26, 2019

in which file we have to force the soloader newer version ????

@codyi96
Copy link
Contributor

codyi96 commented Sep 29, 2019

in which file we have to force the soloader newer version ????

build.gradle under your module folder.

For example:
image

You can check the version by run gradle dependencies in terminal:
image

File: build.gradle.txt

@mars-lan
Copy link

mars-lan commented Oct 9, 2019

Can confirm that forcing soloader to 0.8.0 did not fix the issue. Still seeing the following crash on react-native 0.60.5 + react-native-v8 (i.e. not using hermes)

Fatal Exception: java.lang.UnsatisfiedLinkError
couldn't find DSO to load: libhermes.so
com.facebook.soloader.SoLoader.doLoadLibraryBySoName (SoLoader.java:789)
com.facebook.soloader.SoLoader.loadLibraryBySoName (SoLoader.java:639)
com.facebook.soloader.SoLoader.loadLibrary (SoLoader.java:577)
com.facebook.soloader.SoLoader.loadLibrary (SoLoader.java:525)
com.facebook.hermes.reactexecutor.HermesExecutor.<clinit> (HermesExecutor.java:20)
com.facebook.hermes.reactexecutor.HermesExecutorFactory.create (HermesExecutorFactory.java:27)
com.facebook.react.ReactInstanceManager$5.run (ReactInstanceManager.java:949)
java.lang.Thread.run (Thread.java:761)

@nolife08021
Copy link

react-native v0.60.5
still issue please help me

@auchaphon Upgrade Soloader 0.80 will resolve your problem.

I try this , still not work
Screen Shot 2562-09-24 at 20 30 53

@auchaphon
You can try to do it like this:

configurations.all {
     resolutionStrategy {
       force "com.facebook.soloader:soloader:0.8.0"
     }
}

@codyi96 Hi, I had forced to 0.8.0 version, but still faced the same issue. Any advice?

@codyi96
Copy link
Contributor

codyi96 commented Oct 17, 2019

react-native v0.60.5
still issue please help me

@auchaphon Upgrade Soloader 0.80 will resolve your problem.

I try this , still not work
Screen Shot 2562-09-24 at 20 30 53

@auchaphon
You can try to do it like this:

configurations.all {
     resolutionStrategy {
       force "com.facebook.soloader:soloader:0.8.0"
     }
}

@codyi96 Hi, I had forced to 0.8.0 version, but still faced the same issue. Any advice?

@nolife08021 Could u show me the logcat? Maybe this issue and yours are different, i guess.🤔

@nolife08021
Copy link

@codyi96

Thanks for help. I fixed it with this solution https://github.com/facebook/react-native/issues/25415#issuecomment-541404167

@mharlowfod
Copy link

@nolife08021 That link comes up dead for me, can you confirm if it's still the solution or if it has moved? Any copy-paste would be great, too.

@codyi96
Copy link
Contributor

codyi96 commented Nov 19, 2019

@kyubjn
Copy link

kyubjn commented Nov 28, 2019

I made changes to packagingOptions and things are working fine on all devices both 64-bit & 32 bit devices

    defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        }
    }
    ...
    packagingOptions {
        doNotStrip '*/mips/*.so'
        doNotStrip '*/mips64/*.so'
        pickFirst '**/armeabi-v7a/libc++_shared.so'
        pickFirst '**/x86/libc++_shared.so'
        pickFirst '**/arm64-v8a/libc++_shared.so'
        pickFirst '**/x86_64/libc++_shared.so'

        pickFirst '**/x86/libjsc.so'
        pickFirst '**/armeabi-v7a/libjsc.so'

        exclude "lib/arm64-v8a/libgnustl_shared.so"
        exclude '/lib/mips64/**'
        exclude '/lib/arm64-v8a/**'
        exclude '/lib/x86_64/**'
    }

It work for me. Thank bro

@stale
Copy link

stale bot commented Feb 27, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 27, 2020
@stale
Copy link

stale bot commented Mar 5, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Mar 5, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Mar 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

Successfully merging a pull request may close this issue.