Skip to content Skip to sidebar Skip to footer

Getting "java.lang.unsatisfiedlinkerror: Couldn't Find Dso To Load: Libhermes.so" Error

I'm in the process of migrating a React Native project from react-native version 0.58.5 to 0.60.4. For the Android part I've done all the changes mentioned here I let Hermes disab

Solution 1:

I solved this problem by a tiny change after doing this steps in this article

https://github.com/facebook/react-native/issues/25415

Then make sure to add this jsc-android block to your android/build.gradle:

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npmurl("$rootDir/../node_modules/react-native/android")
        }

        //THIS ONE
        maven {
            // Android JSC is installed from npmurl("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
    }
}

Solution 2:

you can use the older version of com.facebook.soloader:soloader by adding configurations.all into your build.gradle

configurations.all {
    resolutionStrategy {
        force "com.facebook.soloader:soloader:0.8.2"
    }
}

like this build.gradle

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files
    }
}

configurations.all {
    resolutionStrategy {
        force "com.facebook.soloader:soloader:0.8.2"
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

perform below steps if the above steps are not working

app/build.gradle.

android {
  ...
  // add the following packagingOptions 
  packagingOptions {
    pickFirst 'lib/x86_64/libjsc.so'
    pickFirst 'lib/arm64-v8a/libjsc.so'
  }
}

We also added the following to the defaultConfig in the app/build.gradle

ndk {
  abiFilters 'armeabi-v7a', 'x86'
}

Solution 3:

Double-check please all the updates here - https://react-native-community.github.io/upgrade-helper/?from=0.59.9&to=0.60.5

I had the same error, because made a mistake in migration of the android/app/build.gradle file.

Solution 4:

I solved this problem by this steps

  1. install hermesvm : npm i hermesvm
  2. install jsc-android : npm i jsc-android

3.add this lines to app/build.gradle

project.ext.react = [
   entryFile: "index.js" ,
   enableHermes: false
]

defjscFlavor='org.webkit:android-jsc:+'defenableHermes= project.ext.react.get("enableHermes", false);


dependencies {
   if (enableHermes) {
       defhermesPath="../../node_modules/hermesvm/android/";
       debugImplementation files(hermesPath + "hermes-debug.aar")
       releaseImplementation files(hermesPath + "hermes-release.aar")
    }
   else { implementation jscFlavor }
  1. add this jsc-android block to your android/build.gradle:
     allprojects {
       repositories {
         maven {
           url("$rootDir/../node_modules/react-native/android")
         }
         maven {
            url "$rootDir/../node_modules/react-native/android"
         }
         google()
         jcenter()
       }
     }

Post a Comment for "Getting "java.lang.unsatisfiedlinkerror: Couldn't Find Dso To Load: Libhermes.so" Error"