Getting “java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so” error

前端 未结 4 1092
旧时难觅i
旧时难觅i 2021-01-17 18:53

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

4条回答
  •  无人共我
    2021-01-17 19:32

    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
    ]
    
    def jscFlavor = 'org.webkit:android-jsc:+'
    def enableHermes = project.ext.react.get("enableHermes", false);
    
    
    dependencies {
       if (enableHermes) {
           def hermesPath = "../../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()
           }
         }
    

提交回复
热议问题