facebook / react-native

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

Getting SIGABRT Crash on release build. libc.so #29978

Open afkcodes opened 3 years ago

afkcodes commented 3 years ago

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

Did looked for related issues did not find any solution for this, the crash is prominent for almost most of the user on my end on my device im unable to reproduce it if someone has faced the crash please help me get away with this. I have hermes enabled for my app.

React Native version:

System:
    OS: Linux 5.8 Manjaro Linux
    CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
    Memory: 14.79 GB / 19.40 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
    Yarn: Not Found
    npm: 6.14.6 - ~/.nvm/versions/node/v12.18.3/bin/npm
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 11.0.8 - /usr/lib/jvm/default/bin/javac
    Python: 3.8.5 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: ^3.0.5-alpha.1 => 3.2.1 
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Unable to produce on my devices but i am able to see this crash on users in production. Probably happening happening while the app starts as i can see in the logs,

Expected Results

This crash is too prominent more than 20% users are facing the crash need a fix

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

Crashed: Thread :  SIGABRT  0x000027b900000bf9
#00 pc 0x72c8ba5b3c libc.so 
#01 pc 0x72c8ba5b0c libc.so 
#02 pc 0x722553f124 libc++_shared.so 
#03 pc 0x722553b3d4 libc++_shared.so 
#04 pc 0x7224ec43b4 libhermes-executor-release.so 
#05 pc 0x7224ec48bc libhermes-executor-release.so 
#06 pc 0x7224ebcffc libhermes-executor-release.so 
#07 pc 0x7224eae4e8 libhermes-executor-release.so 
#08 pc 0x7224eb0c74 libhermes-executor-release.so 
#09 pc 0x7224ea84c8 libhermes-executor-release.so 
#10 pc 0x7224876264 libhermes.so 
#11 pc 0x7224875be4 libhermes.so 
#12 pc 0x722487ffac libhermes.so 
#13 pc 0x722488e9f0 libhermes.so 
#14 pc 0x7224891e34 libhermes.so 
#15 pc 0x722488f93c libhermes.so 
#16 pc 0x722487fb0c libhermes.so 
#17 pc 0x722488ea08 libhermes.so 
#18 pc 0x7224891e34 libhermes.so 
#19 pc 0x722488f93c libhermes.so 
#20 pc 0x722487fb0c libhermes.so 
#21 pc 0x722488ea08 libhermes.so 
#22 pc 0x7224891e34 libhermes.so 
#23 pc 0x722488f93c libhermes.so 
#24 pc 0x722487fb0c libhermes.so 
#25 pc 0x722488ea08 libhermes.so 
#26 pc 0x7224891e34 libhermes.so 
#27 pc 0x722488f93c libhermes.so 
#28 pc 0x7224900dc0 libhermes.so 
#29 pc 0x722487ffac libhermes.so 
#30 pc 0x722488e9f0 libhermes.so 
#31 pc 0x7224891e34 libhermes.so 
#32 pc 0x722488f93c libhermes.so 
#33 pc 0x7224900dc0 libhermes.so 
#34 pc 0x722487ffac libhermes.so 
#35 pc 0x722488e9f0 libhermes.so 
#36 pc 0x7224891e34 libhermes.so 
#37 pc 0x722488f93c libhermes.so 
#38 pc 0x722487ee28 libhermes.so 
#39 pc 0x7224900b70 libhermes.so 
#40 pc 0x722487ffac libhermes.so 
#41 pc 0x722488e9f0 libhermes.so 
#42 pc 0x7224891e34 libhermes.so 
#43 pc 0x722488f93c libhermes.so 
#44 pc 0x722487fb0c libhermes.so 
#45 pc 0x722488ea08 libhermes.so 
#46 pc 0x7224891e34 libhermes.so 
#47 pc 0x722488f93c libhermes.so 
#48 pc 0x722487fb0c libhermes.so 
#49 pc 0x7224870108 libhermes.so 
#50 pc 0x7224eb1334 libhermes-executor-release.so 
#51 pc 0x7224eb1190 libhermes-executor-release.so 
#52 pc 0x7224eab5e4 libhermes-executor-release.so 
#53 pc 0x7224eae034 libhermes-executor-release.so 
#54 pc 0x7224fa0d58 libreactnativejni.so 
#55 pc 0x7224fa2350 libreactnativejni.so 
#56 pc 0x7224f68d48 libreactnativejni.so 
#57 pc 0x7224f59a70 libreactnativejni.so 
#58 pc 0x7224f599ec libreactnativejni.so 
#59 pc 0x724331e9e0 libart.so 
#60 pc 0x3ffffffc  
#61 pc 0x136412ec  
#62 pc 0x19d5213c  
#63 pc 0x136412ec  
SConaway commented 3 years ago

Are you running this on Android or on linux?

Side note: you may want to upgrade your installation of @react-native-community/cli, as seen here.

afkcodes commented 3 years ago

@SConaway Its on Android and the crash happens on an Android device.

SConaway commented 3 years ago

Are there other any details of the crash logs?

Try upgrading the cli

afkcodes commented 3 years ago

@SConaway i am not seeing any thing more abou the crash, i will surely update the cli and put a new build and see how it goes thanks for help.

SConaway commented 3 years ago

No problem. I'm a bit better with the iOS side of things but still tried to help.

JerakRus commented 3 years ago

@ashishfeels Hi, did you manage to solve the problem? We have something similar happening on devices of users in production

afkcodes commented 3 years ago

@JerakRus i havent gave an update so cant tell much about it.will let you know when i do

chrisglein commented 3 years ago

Do you have any information to indicate this is a React Native core issue? Have you looked at the Hermes repo to see if there's anything there? Does it repro without Hermes?

afkcodes commented 3 years ago

@chrisglein this actually happened twice when i was not using hermes.

nikDemyankov commented 3 years ago

Hi. We've started to get the same crash in crashlytics after releasing new version with target sdk set to 29 (before it was 28). Effecting mainly Android 10 (80% of all crashes) and Android 9 (15% of all crashes) devices. From the logs it seems like a lot of them are happening on the startup. But quite few at random time.

We've tried to reproduce it on different devices and emulators - no luck.

Hermes is disabled, running react-native@0.61.5.

afkcodes commented 3 years ago

What i have found out that almost all of the crashes in my case is happening in Redmi/Mi Devices.

safaiyeh commented 3 years ago

Hi @nikDemyankov thanks for a bit more context. It is hard to pinpoint the specific issue, is there more information you could provide? Which components? Which user interaction lead to this? etc?

RodolfoGS commented 3 years ago

Same issue on react-native: 0.63.3

Crashed: Thread :  SIGSEGV  0x0000000000000010
#00 pc 0x7de39e0748 libjsc.so 
#01 pc 0x7de3a2cfe8 libjsc.so 
#02 pc 0x7ef3e8b0c8 libc.so 
SConaway commented 3 years ago

@RodolfoGS

Just a shot in the dark, but what is your Android SDK setup? Meaning, what is the output of react-native info in your project? What SDK tools are specified in either android/build.gradle or android/app/build.gradle?

RodolfoGS commented 3 years ago

@SConaway react-native info

System:
    OS: macOS 10.15.5
    CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
    Memory: 31.79 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.13.0 - /usr/local/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK:
      Android NDK: 21.3.6528147
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6514223
    Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
  Languages:
    Java: 12.0.1 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: ~0.63.3 => 0.63.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
SConaway commented 3 years ago

@RodolfoGS What is your android/build.gradle (this matters since it says how you're building the app)?

RodolfoGS commented 3 years ago

@SConaway This?

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29

        // react-native-iap required
        androidXAnnotation = "1.1.0"
        androidXBrowser = "1.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.3.3'
        classpath("com.android.tools.build:gradle:3.5.3")

        // Crashlytics required (Doc: https://rnfirebase.io/crashlytics/android-setup#2-add-the-firebase-crashlytics-plugin-dependency)
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven {
            // react-native-background-fetch
            url("${project(':react-native-background-fetch').projectDir}/libs")
        }

        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}
SConaway commented 3 years ago

Yep, that's what I meant. I don't see anything that sticks out to me there, so sorry.

RodolfoGS commented 3 years ago

@SConaway I just updated my comment adding all content of android/build.gradle

SConaway commented 3 years ago

FWIW, you can upgrade these:

  1. 'com.google.gms:google-services:4.3.3' --> 'com.google.gms:google-services:4.3.4'
  2. "com.android.tools.build:gradle:3.5.3" --> 'com.android.tools.build:gradle:4.2.0-alpha15' [NOTE: this one may require you to bump your gradle version in android/gradle/gradlew.properties to 6.7 — follow instructions given if it errors] 3.'com.google.firebase:firebase-crashlytics-gradle:2.2.0' --> 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
RodolfoGS commented 3 years ago

I'll test that, thanks!

cmds4410 commented 3 years ago

@RodolfoGS I'm seeing the same error, did upgrading those help?

RodolfoGS commented 3 years ago

I was using JSC and now I'm switching to Hermes engine and works good so far. I didn't make those updates for now.

wangchongwei commented 3 years ago

Same issue on react-native: 0.59.10 I got the error after We set targetSdk to 29, it was 28. Any help?

ArturTimoxin commented 3 years ago

I got the same problem.

React Native environment:

System: OS: macOS 10.15.6 CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz Memory: 1.09 GB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.14.1 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0 Android SDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.6858069 Xcode: 12.0/12A7209 - /usr/bin/xcodebuild Languages: Java: 13.0.2 - /usr/bin/javac Python: 2.7.15 - /usr/local/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.2 => 0.63.2 npmGlobalPackages: *react-native*: Not Found

This is information from Firebase Crashlytics for my project.

image

image

Did someone fix this problem?

Titozzz commented 3 years ago

This bug is happening to some of my users, 100% HUAWEI phones, and android 9-10

libc abort
libc pthread_once
libc <unknown>
libc pthread_mutex_lock
libc++ std::__1::mutex::lock
libandroid AAssetManager_open
libreactnativejni facebook::react::JniJSModulesUnbundle::getModule
libjscexecutor facebook::react::RAMBundleRegistry::getModule
libjscexecutor facebook::react::JSIExecutor::nativeRequire
wutiange commented 3 years ago

我遇到的问题是这样的: My problem is this:

OS Version: Android 9 (COR-AL10 9.1.0.346(C00E336R1P1)) Report Version: 104

Exception Type: Unknown (SIGSEGV)

Application Specific Information: Segfault

Thread 0 Crashed: 0 libjsc.so 0x7136863748 + 486246070088 1 libjsc.so 0x71368affec + 486246383596 2 libjsc.so 0x713689b0ac + 486246297772 3 libjsc.so 0x71368a5488 + 486246339720 4 libjsc.so 0x71368a5010 + 486246338576 5 libjsc.so 0x71369679c8 + 486247135688 6 libjsc.so 0x7136964e94 + 486247124628 7 libjsc.so 0x71369656c0 + 486247126720 8 libjsc.so 0x713694afe8 + 486247018472 9 libjsc.so 0x7136949a48 + 486247012936 10 libjsc.so 0x713694e840 + 486247032896 11 libjsc.so 0x7136d79e80 + 486251404928 12 libjsc.so 0x7136d87088 + 486251458696 13 libjsc.so 0x7136db2dcc + 486251638220 14 libc.so 0x71d97c6588 __pthread_start 15 libc.so 0x71d97671dc __start_thread 16 0x0

EOF

howg0924 commented 3 years ago

We experienced the same crash after upgrade targetSdk from 28 to 29.

We are on RN 0.59.10 and currently have difficulties to upgrade RN version.

Most crashes happened on app start. Our crash stack is:

Crashed: Thread : SIGSEGV 0x0000000000000010

00 pc 0x75c6647748 libjsc.so

01 pc 0x75c6693fe8 libjsc.so

02 pc 0x76cd285314 libc.so

Anyone know how to solve this? @wangchongwei did you find a solution?

aamir-ans commented 3 years ago

@RodolfoGS hey is switching to Hermes engine removed this crashes ? I'm facing same crashes Crashed: Thread : SIGSEGV 0x0000000000000040

00 pc 0x7d801ea9bc libjsc.so

01 pc 0x7d801ea9c4 libjsc.so

02 pc 0x7e8f5e6af0 libc.so

afkcodes commented 3 years ago

switching to hermes will not solve the issue i have hermes enabled but still i see this crash, hope this gets addressed in next update.

aamir-ans commented 3 years ago

@afkcodes Is this related to something specific react-native module or something else ?

afkcodes commented 3 years ago

i still dont have any answer to that

aamir-ans commented 3 years ago

@afkcodes @RodolfoGS Any solution for this crash Crashed: Thread : SIGSEGV 0x0000000000000040

00 pc 0x7d801ea9bc libjsc.so

1 pc 0x7d801ea9c4 libjsc.so

2 pc 0x7e8f5e6af0 libc.so

I am not able to reproduce the same crash I have checked on multiple devices, seems like this is internal crash and app is working as expected. have you guys at least able to reproduce ? or have any point that might causes the crash ?

JerakRus commented 3 years ago

About 5% of my users experience this crash sometimes. And I also could not reproduce it. But recently, when a user contacted our technical support, some employees managed to do it. A crash occurs when uploading several images (more than 4-5) from the device to our server. For loading, we use the image-crop-picker, form the data from it into FormData and send it to the server using axios. For 5-6 photos in a row, the application simply crashes, and this crash comes to crashlytic. Nevertheless, the crash is reproduced not on all devices, but it definitely happens on Xiaomi Mi A2, Samsung Galaxy S20. I still can't reproduce on my device (redmi note8 pro), but hopefully it helps someone here to reproduce.

react-native: 0.63.4 with Hermes engine.

efstathiosntonas commented 3 years ago

@JerakRus do you by any chance use base64 on these images? I think the issue might be memory allocation.

I'm getting the same errors after switching to api 29 on my Xiaomi device (at least since it's not out in production yet).

JerakRus commented 3 years ago

@efstathiosntonas Hello! base64 actually requires more memory than the image itself by about 1.5 times. I ran into these problems about a year ago, and tried to get away from them. So no more I do not use, as I wrote above, the image is transmitted through FormData.

amit-harjani commented 3 years ago

we are using the react native 63 version and getting the crashes on crashlytics. libc.so missing. image

shukerullah commented 3 years ago

react: 16.11.0 react-native: 0.62.2 react-native-firebase/analytics: 7.6.10 react-native-firebase/app: 8.4.7 react-native-firebase/crashlytics: 10.4.1

libc.so unknown

Screen Shot 2021-01-11 at 1 41 04 PM

@amit-harjani Did you find solution?

trizin commented 3 years ago

Same issue here, very frustrating.

nokite commented 3 years ago

Same issue. 93 crashes affecting 4 users. Started happening out of the blue, without any changes in the app. This version has been live for a month (see screenshot). All Android 10, but from different manufacturers and performance classes (3 cheaper, 1 high-end chip - Samsung A41/50, Pixel 3a, Huawei P20).

Happens near startup. SIGABRT 0x0000000000000000 "Trace": 0 libc.so, 2 libart.so, 3 libbase.so, 4 libart.so, 16 boot-framework.oat, 20 libart.so

hermes-engine ^0.2.1" react: 16.9.0 react-native: 0.61.5

React-native Proguard rules (black magic):

-dontobfuscate

-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
-keep,allowobfuscation @interface com.facebook.jni.annotations.DoNotStrip

-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keep @com.facebook.jni.annotations.DoNotStrip class *
-keepclassmembers class * {
    @com.facebook.proguard.annotations.DoNotStrip *;
    @com.facebook.common.internal.DoNotStrip *;
    @com.facebook.jni.annotations.DoNotStrip *;
}

-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
  void set*(***);
  *** get*();
}

-keep class * implements com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * implements com.facebook.react.bridge.NativeModule { *; }
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }

-dontwarn com.facebook.react.**
-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }

-keep class com.facebook.hermes.unicode.** { *; }

targetSdkVersion 29 abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" minifyEnabled true multiDexEnabled true com.android.tools.build:gradle:4.1.1 buildToolsVersion - automatic

image

diegotsi commented 3 years ago

same here, that's my app/build.gradle file (about the paths: we are using monorepo)

react native: 0.63.3

apply plugin: "com.android.application"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply plugin: 'io.fabric'

import com.android.build.OutputFile

/**
 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
 * and bundleReleaseJsAndAssets).
 * These basically call `react-native bundle` with the correct arguments during the Android build
 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
 * bundle directly from the development server. Below you can see all the possible configurations
 * and their defaults. If you decide to add a configuration block, make sure to add it before the
 * `apply from: "../../node_modules/react-native/react.gradle"` line.
 *
 * project.ext.react = [
 *   // the name of the generated asset file containing your JS bundle
 *   bundleAssetName: "index.android.bundle",
 *
 *   // the entry file for bundle generation. If none specified and
 *   // "index.android.js" exists, it will be used. Otherwise "index.js" is
 *   // default. Can be overridden with ENTRY_FILE environment variable.
 *   entryFile: "index.android.js",
 *
 *   // https://reactnative.dev/docs/performance#enable-the-ram-format
 *   bundleCommand: "ram-bundle",
 *
 *   // whether to bundle JS and assets in debug mode
 *   bundleInDebug: false,
 *
 *   // whether to bundle JS and assets in release mode
 *   bundleInRelease: true,
 *
 *   // whether to bundle JS and assets in another build variant (if configured).
 *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
 *   // The configuration property can be in the following formats
 *   //         'bundleIn${productFlavor}${buildType}'
 *   //         'bundleIn${buildType}'
 *   // bundleInFreeDebug: true,
 *   // bundleInPaidRelease: true,
 *   // bundleInBeta: true,
 *
 *   // whether to disable dev mode in custom build variants (by default only disabled in release)
 *   // for example: to disable dev mode in the staging build type (if configured)
 *   devDisabledInStaging: true,
 *   // The configuration property can be in the following formats
 *   //         'devDisabledIn${productFlavor}${buildType}'
 *   //         'devDisabledIn${buildType}'
 *
 *   // the root of your project, i.e. where "package.json" lives
 *   root: "../../",
 *
 *   // where to put the JS bundle asset in debug mode
 *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
 *
 *   // where to put the JS bundle asset in release mode
 *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in debug mode
 *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in release mode
 *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
 *
 *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
 *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
 *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
 *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
 *   // for example, you might want to remove it from here.
 *   inputExcludes: ["android/**", "ios/**"],
 *
 *   // override which node gets called and with what additional arguments
 *   nodeExecutableAndArgs: ["node"],
 *
 *   // supply additional arguments to the packager
 *   extraPackagerArgs: []
 * ]
 */

project.ext.react = [
    entryFile: "apps/al-wakrah/index.js",
    root: "../../../../",
    enableHermes: true,  // clean and rebuild if changing
    hermesCommand: "../../../../node_modules/hermes-engine/%OS-BIN%/hermesc",
]

project.ext {
  set('react-native', [
    versions: [
      // Overriding Library SDK Versions
      firebase: [
        bom: "20.1.0",
        messaging: "20.1.0"
      ],
    ],
  ])
}

apply from: "../../../../node_modules/react-native/react.gradle"

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

/**
 * The preferred build flavor of JavaScriptCore.
 *
 * For example, to use the international variant, you can use:
 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
 *
 * The international variant includes ICU i18n library and necessary data
 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
 * give correct results when using with locales other than en-US.  Note that
 * this variant is about 6MiB larger per architecture than default.
 */
def jscFlavor = 'org.webkit:android-jsc:+'

/**
 * Whether to enable the Hermes VM.
 *
 * This should be set on project.ext.react and mirrored here.  If it is not set
 * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
 * and the benefits of using Hermes will therefore be sharply reduced.
 */
def enableHermes = project.ext.react.get("enableHermes", false);

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "br.com.votorantim.votorantim.jsmpro"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 270
        versionName "4.20.1"
        multiDexEnabled true
        resValue "string", "versionCode", "${defaultConfig.versionCode}"
        resValue "string", "versionName", "${defaultConfig.versionName}"

        ndk {
          abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
        }
        missingDimensionStrategy 'react-native-camera', 'general'

        setProperty("archivesBaseName", "alwakrah.v" + versionName + "(" + versionCode + ")")
    }

    dexOptions {
       javaMaxHeapSize "3g"
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }

       release {
        storeFile file(JSM_RELEASE_STORE_FILE)
        storePassword JSM_RELEASE_STORE_PASSWORD
        keyAlias JSM_RELEASE_KEY_ALIAS
        keyPassword JSM_RELEASE_KEY_PASSWORD
      }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
            applicationIdSuffix ".debug"
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://facebook.github.io/react-native/docs/signed-apk-android.
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }

    packagingOptions {
      pickFirst '**/x86/libc++_shared.so'
      pickFirst '**/x86/libjsc.so'
      pickFirst '**/x86_64/libjsc.so'
      pickFirst '**/arm64-v8a/libjsc.so'
      pickFirst '**/arm64-v8a/libc++_shared.so'
      pickFirst '**/x86_64/libc++_shared.so'
      pickFirst '**/armeabi-v7a/libc++_shared.so'
      pickFirst '**/armeabi-v7a/libjsc.so'
    }
}

dependencies {
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation fileTree(dir: "libs", include: ["*.jar"])
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
    implementation "com.google.android.gms:play-services-base:16.1.0"
    implementation 'org.conscrypt:conscrypt-android:2.1.0'

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
      exclude group:'com.facebook.fbjni'
    }
    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }
    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }
    if (enableHermes) {
      def hermesPath = "../../../../node_modules/hermes-engine/android/";
      debugImplementation files(hermesPath + "hermes-debug.aar")
      releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
      implementation jscFlavor
    }

    implementation 'com.google.firebase:firebase-analytics:17.2.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    def multidex_version = "2.0.1"
    implementation 'androidx.multidex:multidex:$multidex_version'
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply from: file("../../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project, "../../..")
apply plugin: 'com.google.gms.google-services'

apply from: "../../../../node_modules/react-native-vector-icons/fonts.gradle"

Captura de Tela 2021-01-14 às 08 33 43 Captura de Tela 2021-01-14 às 08 33 20

bahtiyarerden commented 3 years ago

Any update? I've been encountering this problem since I updated RN version 0.59.10 to 0.63.3

githubbla commented 3 years ago

I see it's mostly happening on Android 7.0 or 7.1.1

SurajMDurgad commented 3 years ago

Finally I was able to reproduce the crash on one of my test device -

  --------- beginning of crash
2021-01-30 18:05:34.282 4728-5593/com.quizizz_mobile A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x28 in tid 5593 (RenderThread), pid 4728 (.quizizz_mobile)
2021-01-30 18:05:34.438 6086-6086/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2021-01-30 18:05:34.439 1192-1192/? I//system/bin/tombstoned: received crash request for pid 5593
2021-01-30 18:05:34.439 6086-6086/? I/crash_dump64: performing dump of process 4728 (target tid = 5593)
2021-01-30 18:05:34.461 6086-6086/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-01-30 18:05:34.461 6086-6086/? A/DEBUG: Build fingerprint: 'OnePlus/OnePlus5T/OnePlus5T:10/QKQ1.191014.012/2010292059:user/release-keys'
2021-01-30 18:05:34.461 6086-6086/? A/DEBUG: Revision: '0'
2021-01-30 18:05:34.461 6086-6086/? A/DEBUG: ABI: 'arm64'
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: Timestamp: 2021-01-30 18:05:34+0530
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: pid: 4728, tid: 5593, name: RenderThread  >>> com.quizizz_mobile <<<
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: uid: 10377
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x28
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: Cause: null pointer dereference
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x0  0000000000000000  x1  00000078032e025c  x2  0000000000000002  x3  0000007702bdd2f8
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x4  0000000000000000  x5  0000007702bdd2c0  x6  0000000000000000  x7  000000780309ebcc
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x8  0000000000000000  x9  0000000000000000  x10 0000000000000046  x11 0000000000000000
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x12 0000000000000000  x13 0000000000000000  x14 000000780309f241  x15 00000078032f9620
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x16 0000007803669338  x17 00000078032e5370  x18 00000077003da000  x19 0000000000000000
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x20 00000076eef99188  x21 0000000000000000  x22 0000000000000004  x23 0000000000000440
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x24 0000000000000280  x25 0000007702be5020  x26 0000007803664658  x27 0000000080003816
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x28 0000000000000016  x29 0000007702bdd2e0
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     sp  0000007702bdd2d0  lr  00000078033833f0  pc  00000078032e5380
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG: backtrace:
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #00 pc 00000000002d5380  /system/lib64/libhwui.so (SkSurface::getCanvas()+16) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #01 pc 00000000003733ec  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+1136) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #02 pc 000000000036f044  /system/lib64/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+1076) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #03 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #04 pc 00000000002646f0  /system/lib64/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+1100) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #05 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #06 pc 000000000026457c  /system/lib64/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+728) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #07 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #08 pc 000000000026457c  /system/lib64/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+728) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #09 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #10 pc 000000000026457c  /system/lib64/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+728) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #11 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #12 pc 0000000000286ed0  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+584) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #13 pc 00000000002f7260  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderLayersImpl(android::uirenderer::LayerUpdateQueue const&, bool)+516) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #14 pc 000000000026ff94  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderFrame(android::uirenderer::LayerUpdateQueue const&, SkRect const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, bool, android::uirenderer::Rect const&, sk_sp<SkSurface>, SkMatrix const&)+120) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #15 pc 000000000026fbf0  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::draw(android::uirenderer::renderthread::Frame const&, SkRect const&, SkRect const&, android::uirenderer::LightGeometry const&, android::uirenderer::LayerUpdateQueue*, android::uirenderer::Rect const&, bool, android::uirenderer::LightInfo const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, android::uirenderer::FrameInfoVisualizer*)+388) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #16 pc 00000000002d639c  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+720) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #17 pc 00000000002d5554  /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+380) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #18 pc 00000000002e00d4  /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+228) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #19 pc 00000000002dfdbc  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+584) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #20 pc 00000000000135f0  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+328) (BuildId: fd6cd7b199f704af2f5fadc967b57199)
2021-01-30 18:05:34.507 6086-6086/? A/DEBUG:       #21 pc 00000000000e6890  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: e55e6e4c631509598633769798683023)
2021-01-30 18:05:34.507 6086-6086/? A/DEBUG:       #22 pc 0000000000084b6c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: e55e6e4c631509598633769798683023)
2021-01-30 18:05:34.572 2654-2654/? D/KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
2021-01-30 18:05:34.574 1526-1630/? W/AlarmManager: Unrecognized alarm listener com.android.server.b@af657e4
2021-01-30 18:05:34.854 1192-1192/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_03
2021-01-30 18:05:34.855 1526-6090/? I/DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
2021-01-30 18:05:34.855 1526-6089/? W/ActivityTaskManager:   Force finishing activity com.quizizz_mobile/.MainActivity
2021-01-30 18:05:34.856 1526-6090/? D/FrameworkEventCollector: recordAppIssue PN: com.quizizz_mobile
2021-01-30 18:05:34.856 1526-6089/? D/OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{42cad9 token=Token{bd7e120 ActivityRecord{46bd823 u0 net.oneplus.launcher/.Launcher t778}}} pkgName net.oneplus.launcher
2021-01-30 18:05:34.857 1526-6089/? D/ActivityTrigger: ActivityTrigger activityPauseTrigger 
2021-01-30 18:05:34.858 1526-6245/? D/cpe: OS Event: crash

The crash looks something like that at least in my case /system/lib64/libhwui.so (SkSurface::getCanvas()+16) was the reason for crash.

This comment helped me to resolve this crash - https://github.com/software-mansion/react-native-screens/issues/105#issuecomment-664353593

Basically there is an issue with react-native-webview adding androidHardwareAccelerationDisabled={true} to your webview should stop this crash. At least the one I've mentioned above. I've tested it and it did stop the app from crashing.

GiladR1979 commented 3 years ago

Finally I was able to reproduce the crash on one of my test device -

  --------- beginning of crash
2021-01-30 18:05:34.282 4728-5593/com.quizizz_mobile A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x28 in tid 5593 (RenderThread), pid 4728 (.quizizz_mobile)
2021-01-30 18:05:34.438 6086-6086/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2021-01-30 18:05:34.439 1192-1192/? I//system/bin/tombstoned: received crash request for pid 5593
2021-01-30 18:05:34.439 6086-6086/? I/crash_dump64: performing dump of process 4728 (target tid = 5593)
2021-01-30 18:05:34.461 6086-6086/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-01-30 18:05:34.461 6086-6086/? A/DEBUG: Build fingerprint: 'OnePlus/OnePlus5T/OnePlus5T:10/QKQ1.191014.012/2010292059:user/release-keys'
2021-01-30 18:05:34.461 6086-6086/? A/DEBUG: Revision: '0'
2021-01-30 18:05:34.461 6086-6086/? A/DEBUG: ABI: 'arm64'
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: Timestamp: 2021-01-30 18:05:34+0530
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: pid: 4728, tid: 5593, name: RenderThread  >>> com.quizizz_mobile <<<
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: uid: 10377
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x28
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG: Cause: null pointer dereference
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x0  0000000000000000  x1  00000078032e025c  x2  0000000000000002  x3  0000007702bdd2f8
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x4  0000000000000000  x5  0000007702bdd2c0  x6  0000000000000000  x7  000000780309ebcc
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x8  0000000000000000  x9  0000000000000000  x10 0000000000000046  x11 0000000000000000
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x12 0000000000000000  x13 0000000000000000  x14 000000780309f241  x15 00000078032f9620
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x16 0000007803669338  x17 00000078032e5370  x18 00000077003da000  x19 0000000000000000
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x20 00000076eef99188  x21 0000000000000000  x22 0000000000000004  x23 0000000000000440
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x24 0000000000000280  x25 0000007702be5020  x26 0000007803664658  x27 0000000080003816
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     x28 0000000000000016  x29 0000007702bdd2e0
2021-01-30 18:05:34.462 6086-6086/? A/DEBUG:     sp  0000007702bdd2d0  lr  00000078033833f0  pc  00000078032e5380
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG: backtrace:
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #00 pc 00000000002d5380  /system/lib64/libhwui.so (SkSurface::getCanvas()+16) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #01 pc 00000000003733ec  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+1136) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #02 pc 000000000036f044  /system/lib64/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+1076) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #03 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #04 pc 00000000002646f0  /system/lib64/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+1100) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #05 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #06 pc 000000000026457c  /system/lib64/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+728) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #07 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #08 pc 000000000026457c  /system/lib64/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+728) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #09 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #10 pc 000000000026457c  /system/lib64/libhwui.so (SkGpuDevice::drawDrawable(SkDrawable*, SkMatrix const*, SkCanvas*)+728) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #11 pc 000000000023caf0  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+164) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #12 pc 0000000000286ed0  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+584) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #13 pc 00000000002f7260  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderLayersImpl(android::uirenderer::LayerUpdateQueue const&, bool)+516) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #14 pc 000000000026ff94  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderFrame(android::uirenderer::LayerUpdateQueue const&, SkRect const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, bool, android::uirenderer::Rect const&, sk_sp<SkSurface>, SkMatrix const&)+120) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #15 pc 000000000026fbf0  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::draw(android::uirenderer::renderthread::Frame const&, SkRect const&, SkRect const&, android::uirenderer::LightGeometry const&, android::uirenderer::LayerUpdateQueue*, android::uirenderer::Rect const&, bool, android::uirenderer::LightInfo const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, android::uirenderer::FrameInfoVisualizer*)+388) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #16 pc 00000000002d639c  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+720) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #17 pc 00000000002d5554  /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+380) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #18 pc 00000000002e00d4  /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+228) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #19 pc 00000000002dfdbc  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+584) (BuildId: 89872b4824183d6b36a5314bd0e7f303)
2021-01-30 18:05:34.506 6086-6086/? A/DEBUG:       #20 pc 00000000000135f0  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+328) (BuildId: fd6cd7b199f704af2f5fadc967b57199)
2021-01-30 18:05:34.507 6086-6086/? A/DEBUG:       #21 pc 00000000000e6890  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: e55e6e4c631509598633769798683023)
2021-01-30 18:05:34.507 6086-6086/? A/DEBUG:       #22 pc 0000000000084b6c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: e55e6e4c631509598633769798683023)
2021-01-30 18:05:34.572 2654-2654/? D/KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
2021-01-30 18:05:34.574 1526-1630/? W/AlarmManager: Unrecognized alarm listener com.android.server.b@af657e4
2021-01-30 18:05:34.854 1192-1192/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_03
2021-01-30 18:05:34.855 1526-6090/? I/DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
2021-01-30 18:05:34.855 1526-6089/? W/ActivityTaskManager:   Force finishing activity com.quizizz_mobile/.MainActivity
2021-01-30 18:05:34.856 1526-6090/? D/FrameworkEventCollector: recordAppIssue PN: com.quizizz_mobile
2021-01-30 18:05:34.856 1526-6089/? D/OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{42cad9 token=Token{bd7e120 ActivityRecord{46bd823 u0 net.oneplus.launcher/.Launcher t778}}} pkgName net.oneplus.launcher
2021-01-30 18:05:34.857 1526-6089/? D/ActivityTrigger: ActivityTrigger activityPauseTrigger 
2021-01-30 18:05:34.858 1526-6245/? D/cpe: OS Event: crash

The crash looks something like that at least in my case /system/lib64/libhwui.so (SkSurface::getCanvas()+16) was the reason for crash.

This comment helped me to resolve this crash - software-mansion/react-native-screens#105 (comment)

Basically there is an issue with react-native-webview adding androidHardwareAccelerationDisabled={true} to your webview should stop this crash. At least the one I've mentioned above. I've tested it and it did stop the app from crashing.

Yeah, it also makes my WebView content invisible...

JerakRus commented 3 years ago

Hello everyone! In general, for about half a year I encountered similar errors and even wrote to the Hermes team. As it turned out, all errors are different, and each one needs to be dealt with separately. But given that Hermes does not have native logs at least until RN 0.63.4, this is impossible.

The problem was solved by replacing the engine with a V8 from Google. I have been testing for 2 days, for 6000 users, every single error has been eliminated. And no new ones have even appeared) So anyone interested can try. The transition is as simple as possible and did not cause any problems. Is that slightly increased the size of the universal apk. But with aab, the size for the user hasn't changed. (https://github.com/Kudo/react-native-v8) By the way, by comparison, it is even better in terms of RAM consumption!

P.S. And sorry for my bad english.

githubbla commented 3 years ago

Hello everyone! In general, for about half a year I encountered similar errors and even wrote to the Hermes team. As it turned out, all errors are different, and each one needs to be dealt with separately. But given that Hermes does not have native logs at least until RN 0.63.4, this is impossible.

The problem was solved by replacing the engine with a V8 from Google. I have been testing for 2 days, for 6000 users, every single error has been eliminated. And no new ones have even appeared) So anyone interested can try. The transition is as simple as possible and did not cause any problems. Is that slightly increased the size of the universal apk. But with aab, the size for the user hasn't changed. (https://github.com/Kudo/react-native-v8) By the way, by comparison, it is even better in terms of RAM consumption!

P.S. And sorry for my bad english.

@JerakRus do you use also smartlook.com ?

JerakRus commented 3 years ago

@githubbla No, I'm sorry, I don't know what it is.)

trizin commented 3 years ago

@JerakRus Hey! I tried to use Hermes and encountered many errors. Most of the functions of the app were broken. I heard that react-native-v8 had some crash problems with the rn<0.63.4 versions. Have you encountered any crash issues yet? Are you using a feature flag such as v8-android-nointl or v8-android-jit?

JerakRus commented 3 years ago

@trizin Hey! In my project, the v8-android-nointl package suited me. A week has passed since the release in production, I have not seen more than one error related to the engine.