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

Seeing lots of ANRs with Hermes #25978

Closed
harryt2 opened this issue Aug 7, 2019 · 7 comments
Closed

Seeing lots of ANRs with Hermes #25978

harryt2 opened this issue Aug 7, 2019 · 7 comments
Labels
Bug Needs: Author Feedback Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@harryt2
Copy link

harryt2 commented Aug 7, 2019

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.)
@harryt2 harryt2 added the Bug label Aug 7, 2019
@react-native-bot
Copy link
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.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Aug 7, 2019
@yashlinmaistry
Copy link

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

Have you been able to fix it?

@tarun29061990
Copy link

Any updates? facing issue with hermes

@yashlinmaistry
Copy link

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'


@affanhashone
Copy link

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

@yashlinmaistry
Copy link

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

@hramos
Copy link
Contributor

hramos commented Jan 21, 2020

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.

@hramos hramos closed this as completed Jan 21, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Oct 5, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Needs: Author Feedback Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants