Skip to content

Seeing lots of ANRs with Hermes #25978

Closed
Closed

Description

@harryt2

I seem to be seeing a lot of ANRs using 0.60.4 and Hermes. I am seriously baffled. Does anyone have any clues about how to fix this? The ANR reports look like this:

Broadcast of Intent { act=com.android.vending.INSTALL_REFERRER flg=0x10 pkg=com.myapp cmp=com.myapp/com.learnium.RNDeviceInfo.RNDeviceReceiver (has extras) }

Broadcast of Intent { act=com.android.vending.INSTALL_REFERRER flg=0x10 pkg=com.myapp cmp=com.myapp/com.tapjoy.InstallReferrerReceiver (has extras) }

Broadcast of Intent { flg=0x10 cmp=com.myapp/com.onesignal.NotificationOpenedReceiver (has extras) }

Input dispatching timed out (AppWindowToken{a29dc97 token=Token{7994b16 ActivityRecord{ac57831 u0 com.myapp/.MainActivity t10831}}}, Waiting because no window has focus but there is a focused application that may eventually add a window when it finishes starting up.)

Activity

  1. react-native-bot commented on Aug 7, 2019

    @react-native-bot
    Collaborator

    Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

    👉 Click here if you want to take another look at the Bug Report issue template.

  2. yashlinmaistry commented on Aug 28, 2019

    @yashlinmaistry

    @harryt2 I've been seeing this too. InstallReferrerReceiver namely

    Have you been able to fix it?

  3. tarun29061990 commented on Sep 4, 2019

    @tarun29061990

    Any updates? facing issue with hermes

  4. yashlinmaistry commented on Sep 6, 2019

    @yashlinmaistry

    I haven't had any luck with it yet.

    Does your app gradle look similar?

    apply plugin: "com.android.application"
    apply plugin: "com.google.firebase.firebase-perf"
    apply plugin: 'io.fabric'
    
    import com.android.build.OutputFile
    
    
    project.ext.react = [
        entryFile: "index.js",
    
        enableHermes: true,
        hermesCommand: "../../node_modules/hermes-engine/%OS-BIN%/hermes",
        // Sometimes (like if you use Android API<17) adb forwards don't work, so you need a bundle in the dev APK
        bundleInDebug: project.hasProperty("bundleInDebug") ? project.getProperty("bundleInDebug") : false,
    ]
    
    def enableHermes = project.ext.react.get("enableHermes", true)
    def jscFlavor = 'org.webkit:android-jsc:+'
    
    //apply from: "../../node_modules/react-native/react.gradle"
    
    def enableSeparateBuildPerCPUArchitecture = false
    
    def enableProguardInReleaseBuilds = false
    
    android {
        compileSdkVersion rootProject.ext.compileSdkVersion
    
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    
        packagingOptions {
            pickFirst '**/libc++_shared.so'
            //pickFirst 'lib/arm64-v8a/libc++_shared.so'
        }
    
        defaultConfig {
    
            minSdkVersion 21// rootProject.ext.minSdkVersion
            targetSdkVersion 28//rootProject.ext.targetSdkVersion
            versionCode 11
            versionName "1.1.8"
    
            // Needed to support API<21, though there is a small chance proguard shrinks things sufficiently
            multiDexEnabled true
        }
        signingConfigs {
            release {
           
    
            }
        }
    
    
        splits {
            abi {
                reset()
                enable enableSeparateBuildPerCPUArchitecture
                universalApk false  // If true, also generate a universal APK
                include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
            }
        }
        buildTypes {
            debug {
                debuggable true
                //ext.enableCrashlytics = true
            }
            release {
                minifyEnabled true
                signingConfig signingConfigs.release
                proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            }
        }
    
    
        flavorDimensions  "client"
        productFlavors {
            flavor1 {
                dimension "client"
                minSdkVersion 21
                applicationIdSuffix ".flavor1"
          
    
            }
            flavor2 {
                dimension "client"
                minSdkVersion 21
                applicationIdSuffix ".flavor2"
    
            }
        }
    
    
        // 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:
                // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
                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
                }
            }
        }
    }
    
    dependencies {
        implementation project(':appcenter-crashes')
        implementation project(':appcenter-analytics')
        implementation project(':appcenter')
    
        if (enableHermes) {
            def hermesPath = "../../node_modules/hermes-engine/android/";  //  <-- change this
            debugImplementation files(hermesPath + "hermes-debug.aar")
            releaseImplementation files(hermesPath + "hermes-release.aar")
        } else {
            implementation jscFlavor
        }
    
        implementation project(':react-native-reanimated')
        implementation project(':react-native-gesture-handler')
        implementation project(':react-native-vector-icons')
        //implementation project(':react-native-firebase')
        implementation fileTree(dir: "libs", include: ["*.jar"])
        implementation "com.facebook.react:react-native:+"  // From node_modules
    
        /* ----------------------------
        *    REACT NATIVE FIREBASE
        * ---------------------------- */
    
        // Library as defined in settings.gradle
        implementation project(path: ':react-native-firebase')
    
        // Required dependencies
        //noinspection GradleCompatible
        implementation "com.google.firebase:firebase-core:16.0.9"
        implementation "com.google.android.gms:play-services-base:16.1.0"
    
        /* -------------------------
        *   OPTIONAL FIREBASE SDKS
        * ------------------------- */
    
        implementation('com.google.firebase:firebase-ads:15.0.1') {
          // exclude `customtabs` as the support lib version is out of date
          // we manually add it as a dependency below with a custom version
          exclude group: 'com.android.support', module: 'customtabs'
        }
    
        // Authentication
        implementation "com.google.firebase:firebase-auth:19.0.0"
        // Analytics
        implementation "com.google.firebase:firebase-analytics:17.1.0"
        // Performance Monitoring
        implementation "com.google.firebase:firebase-perf:19.0.0"
        // Remote Config
        implementation "com.google.firebase:firebase-config:19.0.0"
        // Cloud Storage
        implementation "com.google.firebase:firebase-storage:19.0.0"
        // Dynamic Links
        implementation "com.google.firebase:firebase-dynamic-links:19.0.0"
        // Real-time Database
        implementation "com.google.firebase:firebase-database:19.0.0"
        // Cloud Functions
        implementation "com.google.firebase:firebase-functions:19.0.0"
        // Cloud Firestore
        implementation "com.google.firebase:firebase-firestore:21.0.0"
        // Cloud Messaging / FCM
        implementation "com.google.firebase:firebase-messaging:20.0.0"
    
        // Firebase IID
        //implementation "com.google.firebase:firebase-iid:20.0.0"
    
        // Crashlytics
        //implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
        //    transitive = true
        //}
    
        /* --------------------------------
        *  OPTIONAL SUPPORT LIBS
        * -------------------------------- */
    
        // Needed to support API<21, though there is a small chance proguard shrinks things sufficiently
        implementation 'androidx.multidex:multidex:2.0.0'
    
        // For Firebase Ads
        //noinspection GradleCompatible
        implementation 'androidx.browser:browser:1.0.0'
    
        // For React Native Firebase Notifications
        implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
    }
    
    // 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 plugin: 'com.google.gms.google-services'
    
    
    
  5. affanhashone commented on Oct 22, 2019

    @affanhashone

    @yashlinmaistry have you resolve this issue ? i am also getting this anrs when i create .aab bundle

  6. yashlinmaistry commented on Oct 24, 2019

    @yashlinmaistry

    @affanhashone I still haven't been able to create .aab bundles - as a workaround we are deploying .apks instead

  7. hramos commented on Jan 21, 2020

    @hramos
    Contributor

    Closing after several months without followup from the author. Please make sure to fill in the issue template if you decide to file a new issue.

  8. locked as resolved and limited conversation to collaborators on Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions