title: How can I enable Hermes engine in an updated react-native project?
body: <p>I'm working on a react-native project that was originally using an old react-native version. Updating the project to use the latest react-native version, has been quite succesful in other ways. However, I have not been able to enable Hermes engine for android.</p>
  <p>I have followed the official steps here: <a href="https://reactnative.dev/docs/hermes" rel="noreferrer">Using Hermes</a>. To confirm if Hermes is enabled, I clean and rebuild the android project, run the app in the debug mode and use this code:</p>
  <pre><code>const isHermes = () =&gt; !!global.HermesInternal;
  console.log(isHermes());
  </code></pre>
  <p>Also Flipper v0.80.0 cannot find Hermes app.</p>
  <p><strong>android/build.gradle</strong></p>
  <pre><code>buildscript {
      ext {
          buildToolsVersion = &quot;29.0.3&quot;
          minSdkVersion = 21
          compileSdkVersion = 29
          targetSdkVersion = 29
          ndkVersion = &quot;20.1.5948944&quot;
          supportLibVersion = &quot;29.0.0&quot;
          googlePlayServicesVersion = &quot;+&quot;
          firebaseVersion = &quot;+&quot;
          ext.kotlinVersion = '1.3.10'
      }
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath('com.android.tools.build:gradle:4.1.0')
          classpath &quot;com.google.gms:google-services:4.3.3&quot;
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion&quot;
      }
  }
  
  allprojects {
      repositories {
          mavenLocal()
          maven {
              url(&quot;$rootDir/../node_modules/react-native/android&quot;)
          }
          maven {
              url(&quot;$rootDir/../node_modules/jsc-android/dist&quot;)
          }
          maven {
              url(&quot;$rootDir/../node_modules/detox/Detox-android&quot;)
          }
          maven {
              url &quot;https://sdks.instabug.com/nexus/repository/instabug-cp&quot;
          }
  
          google()
          jcenter()
          maven { url 'https://www.jitpack.io' }
  
          maven { url 'https://maven.google.com' }
      }
  }
  </code></pre>
  <p><strong>android/app/build.gradle</strong></p>
  <pre><code>apply plugin: &quot;com.android.application&quot;
  
  import com.android.build.OutputFile
  
  project.ext.react = [
      enableHermes: true,
  ]
  
  apply from: &quot;../../node_modules/react-native/react.gradle&quot;
  
  def enableSeparateBuildPerCPUArchitecture = false
  
  def enableProguardInReleaseBuilds = false
  
  def jscFlavor = 'org.webkit:android-jsc:+'
  
  apply from: &quot;../../node_modules/react-native-vector-icons/fonts.gradle&quot;
  
  def enableHermes = project.ext.react.get(&quot;enableHermes&quot;, true);
  
  android {
      ndkVersion rootProject.ext.ndkVersion
  
      compileSdkVersion rootProject.ext.compileSdkVersion
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      defaultConfig {
          minSdkVersion rootProject.ext.minSdkVersion
          targetSdkVersion rootProject.ext.targetSdkVersion
          versionCode 8
          versionName &quot;2.0.0&quot;
          testBuildType System.getProperty('testBuildType', 'debug')
          testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
          vectorDrawables.useSupportLibrary = true
      }
      splits {
          abi {
              reset()
              enable enableSeparateBuildPerCPUArchitecture
              universalApk false
              include &quot;armeabi-v7a&quot;, &quot;x86&quot;, &quot;arm64-v8a&quot;, &quot;x86_64&quot;
          }
      }
      signingConfigs {
          debug {
              storeFile file('debug.keystore')
              storePassword 'android'
              keyAlias 'androiddebugkey'
              keyPassword 'android'
          }
          release {
              if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                  storeFile file(MYAPP_UPLOAD_STORE_FILE)
                  storePassword MYAPP_UPLOAD_STORE_PASSWORD
                  keyAlias MYAPP_UPLOAD_KEY_ALIAS
                  keyPassword MYAPP_UPLOAD_KEY_PASSWORD
              }
          }
      }
  
      buildTypes {
          debug {
              signingConfig signingConfigs.debug
          }
      }
  
      applicationVariants.all { variant -&gt;
          variant.outputs.each { output -&gt;
              def versionCodes = [&quot;armeabi-v7a&quot;: 1, &quot;x86&quot;: 2, &quot;arm64-v8a&quot;: 3, &quot;x86_64&quot;: 4]
              def abi = output.getFilter(OutputFile.ABI)
              if (abi != null) { 
                  output.versionCodeOverride =
                          defaultConfig.versionCode * 1000 + versionCodes.get(abi)
              }
  
          }
      }
  
  }
  
  dependencies {
      implementation fileTree(dir: &quot;libs&quot;, include: [&quot;*.jar&quot;])
      implementation &quot;com.facebook.react:react-native:+&quot;  
  
      implementation &quot;androidx.swiperefreshlayout:swiperefreshlayout:1.0.0&quot;
  
      implementation project(':react-native-push-notification')
      implementation 'com.google.firebase:firebase-messaging:20.0.0'
  
      debugImplementation(&quot;com.facebook.flipper:flipper:${FLIPPER_VERSION}&quot;) {
        exclude group:'com.facebook.fbjni'
      }
  
      debugImplementation(&quot;com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}&quot;) {
          exclude group:'com.facebook.flipper'
          exclude group:'com.squareup.okhttp3', module:'okhttp'
      }
  
      debugImplementation(&quot;com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}&quot;) {
          exclude group:'com.facebook.flipper'
      }
  
      if (enableHermes) {
          def hermesPath = &quot;../../node_modules/hermes-engine/android/&quot;;
          debugImplementation files(hermesPath + &quot;hermes-debug.aar&quot;)
          releaseImplementation files(hermesPath + &quot;hermes-release.aar&quot;)
      } else {
          implementation jscFlavor
      }
  
      androidTestImplementation 'junit:junit:4.12'
      implementation 'androidx.annotation:annotation:1.1.0'
      androidTestImplementation 'androidx.annotation:annotation:1.1.0'
      implementation &quot;com.google.firebase:firebase-messaging:{{ android.firebase.messaging }}&quot;
      implementation 'me.leolin:ShortcutBadger:1.1.21@aar'
  }
  
  task copyDownloadableDepsToLibs(type: Copy) {
      from configurations.compile
      into 'libs'
  }
  
  apply from: file(&quot;../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle&quot;); applyNativeModulesAppBuildGradle(project)
  apply plugin: 'com.google.gms.google-services'
  
  </code></pre>
  <p><strong>package.json</strong></p>
  <pre><code>{
    &quot;version&quot;: &quot;0.0.1&quot;,
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;react-native start&quot;,
      &quot;test&quot;: &quot;jest&quot;,
      &quot;lint&quot;: &quot;eslint .&quot;
    },
    &quot;dependencies&quot;: {
      &quot;@aws-sdk/client-cognito-identity&quot;: &quot;^3.4.0&quot;,
      &quot;@aws-sdk/client-s3&quot;: &quot;^3.4.0&quot;,
      &quot;@aws-sdk/credential-provider-cognito-identity&quot;: &quot;^3.4.0&quot;,
      &quot;@react-native-community/async-storage&quot;: &quot;^1.6.1&quot;,
      &quot;@react-native-community/datetimepicker&quot;: &quot;^3.0.9&quot;,
      &quot;@react-native-community/masked-view&quot;: &quot;^0.1.10&quot;,
      &quot;@react-native-community/netinfo&quot;: &quot;^3.2.1&quot;,
      &quot;@react-native-community/push-notification-ios&quot;: &quot;^1.8.0&quot;,
      &quot;@react-native-firebase/analytics&quot;: &quot;^11.0.0&quot;,
      &quot;@react-native-firebase/app&quot;: &quot;^11.0.0&quot;,
      &quot;@react-native-firebase/messaging&quot;: &quot;^11.0.0&quot;,
      &quot;@react-navigation/bottom-tabs&quot;: &quot;^5.11.2&quot;,
      &quot;@react-navigation/drawer&quot;: &quot;^5.11.4&quot;,
      &quot;@react-navigation/native&quot;: &quot;^5.8.10&quot;,
      &quot;@react-navigation/stack&quot;: &quot;^5.12.8&quot;,
      &quot;acorn&quot;: &quot;^6.1.1&quot;,
      &quot;acorn-jsx&quot;: &quot;^5.0.1&quot;,
      &quot;add&quot;: &quot;^2.0.6&quot;,
      &quot;compare-versions&quot;: &quot;^3.6.0&quot;,
      &quot;instabug-reactnative&quot;: &quot;^10.0.0&quot;,
      &quot;jwt-decode&quot;: &quot;^2.2.0&quot;,
      &quot;lodash&quot;: &quot;^4.17.20&quot;,
      &quot;moment&quot;: &quot;^2.29.1&quot;,
      &quot;moment-timezone&quot;: &quot;^0.5.33&quot;,
      &quot;react&quot;: &quot;17.0.1&quot;,
      &quot;react-native&quot;: &quot;0.64.0&quot;,
      &quot;react-native-add-calendar-event&quot;: &quot;^4.0.0&quot;,
      &quot;react-native-animatable&quot;: &quot;^1.3.3&quot;,
      &quot;react-native-app-intro-slider&quot;: &quot;^4.0.4&quot;,
      &quot;react-native-auth0&quot;: &quot;^2.7.0&quot;,
      &quot;react-native-aws3&quot;: &quot;0.0.9&quot;,
      &quot;react-native-elements&quot;: &quot;^3.1.0&quot;,
      &quot;react-native-gesture-handler&quot;: &quot;^1.9.0&quot;,
      &quot;react-native-google-places-autocomplete&quot;: &quot;^1.3.9&quot;,
      &quot;react-native-hyperlink&quot;: &quot;^0.0.19&quot;,
      &quot;react-native-image-crop-picker&quot;: &quot;^0.35.3&quot;,
      &quot;react-native-image-zoom-viewer&quot;: &quot;^3.0.1&quot;,
      &quot;react-native-in-app-notification&quot;: &quot;^3.1.0&quot;,
      &quot;react-native-keyboard-aware-scroll-view&quot;: &quot;^0.9.2&quot;,
      &quot;react-native-keychain&quot;: &quot;^6.2.0&quot;,
      &quot;react-native-localize&quot;: &quot;^2.0.2&quot;,
      &quot;react-native-modal&quot;: &quot;^11.4.0&quot;,
      &quot;react-native-popup-menu&quot;: &quot;^0.15.10&quot;,
      &quot;react-native-push-notification&quot;: &quot;^3.1.9&quot;,
      &quot;react-native-reanimated&quot;: &quot;^1.13.2&quot;,
      &quot;react-native-safe-area-context&quot;: &quot;^3.1.9&quot;,
      &quot;react-native-screens&quot;: &quot;^2.16.1&quot;,
      &quot;react-native-share&quot;: &quot;^5.0.0&quot;,
      &quot;react-native-tab-view&quot;: &quot;^2.10.0&quot;,
      &quot;react-native-touchable-scale&quot;: &quot;^2.1.2&quot;,
      &quot;react-native-vector-icons&quot;: &quot;^7.1.0&quot;,
      &quot;react-native-windows&quot;: &quot;^0.63.15&quot;,
      &quot;react-redux&quot;: &quot;^7.1.0&quot;,
      &quot;redux&quot;: &quot;^4.0.4&quot;,
      &quot;redux-logger&quot;: &quot;^3.0.6&quot;,
      &quot;redux-persist&quot;: &quot;^5.10.0&quot;,
      &quot;redux-thunk&quot;: &quot;^2.3.0&quot;,
      &quot;rn-fetch-blob&quot;: &quot;^0.12.0&quot;,
      &quot;validator&quot;: &quot;^13.5.2&quot;,
      &quot;yarn&quot;: &quot;^1.22.10&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/core&quot;: &quot;^7.12.49&quot;,
      &quot;@babel/runtime&quot;: &quot;^7.12.5&quot;,
      &quot;@react-native-community/eslint-config&quot;: &quot;^2.0.0&quot;,
      &quot;@types/react-native&quot;: &quot;^0.63.43&quot;,
      &quot;@typescript-eslint/eslint-plugin&quot;: &quot;^4.11.1&quot;,
      &quot;@typescript-eslint/parser&quot;: &quot;^4.11.1&quot;,
      &quot;babel-eslint&quot;: &quot;^10.0.1&quot;,
      &quot;babel-jest&quot;: &quot;^26.6.3&quot;,
      &quot;eslint&quot;: &quot;^7.14.0&quot;,
      &quot;eslint-plugin-import&quot;: &quot;^2.22.1&quot;,
      &quot;eslint-plugin-react&quot;: &quot;^7.22.0&quot;,
      &quot;jest&quot;: &quot;^26.6.3&quot;,
      &quot;jetifier&quot;: &quot;^1.6.4&quot;,
      &quot;metro-react-native-babel-preset&quot;: &quot;^0.64.0&quot;,
      &quot;prettier&quot;: &quot;^2.2.1&quot;,
      &quot;prop-types&quot;: &quot;^15.7.2&quot;,
      &quot;react-test-renderer&quot;: &quot;17.0.1&quot;,
      &quot;typescript&quot;: &quot;^4.1.3&quot;
    },
    &quot;resolutions&quot;: {
      &quot;graceful-fs&quot;: &quot;4.2.4&quot;
    },
    &quot;jest&quot;: {
      &quot;preset&quot;: &quot;react-native&quot;
    }
  }
  </code></pre>
  <p><strong>proguard-rules.pro</strong></p>
  <pre><code>-keep class com.facebook.hermes.unicode.** { *; }
  -keep class com.facebook.jni.** { *; }
  </code></pre>