1 year ago

#377182

test-img

Mervzs

React Native build with productFlavors and hermes enabled crashes on app start

I tried to build my app using azure pipelines with this command assembleDevelopRelease. The build is successful but crashes on splashscreen.

    project.ext.react = [
    enableHermes: true,  // clean and rebuild if changing
    entryFile: "index.js",
    bundleAssetName: "index.android.bundle",
    bundleInDebug: true,
    bundleInRelease: true
]


buildTypes {
    debug {
        signingConfig signingConfigs.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.debug
        minifyEnabled enableProguardInReleaseBuilds
        proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        // signingConfig signingConfigs.release
    }
}

flavorDimensions "default"
productFlavors {
    develop {
        dimension "default"
        versionNameSuffix "-dev"
    }
    production {
        dimension "default"
    }
}

dependencies {
//** some codes here **//
if (enableHermes) {
    def hermesPath = "../../node_modules/hermes-engine/android/";
    debugImplementation files(hermesPath + "hermes-debug.aar")
    releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
    implementation jscFlavor
    }
}

the build works when i disable hermes but i need hermes to work for performance upgrade.

Other Details:

"react-native": "0.64.2",

android

react-native

react-native-hermes

0 Answers

Your Answer

Accepted video resources