Giter Site home page Giter Site logo

TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[11], "react-native-screens").ScreenStack') about react-native-screens HOT 28 CLOSED

kabundege avatar kabundege commented on May 27, 2024 4
TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[11], "react-native-screens").ScreenStack')

from react-native-screens.

Comments (28)

kristensala avatar kristensala commented on May 27, 2024 6

Started having the same problem couple days back. Looks like the latest version (3.31.1) has that problem. You have "react-native-screens": "^3.29.0", try without '^'. Seemed to fix it for me right now.

from react-native-screens.

Dsalvat596 avatar Dsalvat596 commented on May 27, 2024 3

I'm having the same (or a similar) issue.

Error: Exception in HostObject::get for prop 'RNSModule': java.lang.UnsatisfiedLinkError: dlopen failed: library "librnscreens.so" not found, js engine: hermes

ERROR TypeError: Cannot read property 'ScreenStack' of undefined

from react-native-screens.

MSaaim avatar MSaaim commented on May 27, 2024 3

Started having the same problem couple days back. Looks like the latest version (3.31.1) has that problem. You have "react-native-screens": "^3.29.0", try without '^'. Seemed to fix it for me right now.

I was facing the same problem, but removing the '^' from "react-native-screens": "^3.29.0" in package.json file solved the issue. Thank you @kristensala for providing the solution.

from react-native-screens.

kabundege avatar kabundege commented on May 27, 2024 2

reactNativeArchitectures value in gradle.properties is

reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

from react-native-screens.

Chandansharma1512 avatar Chandansharma1512 commented on May 27, 2024 2

Started having the same problem couple days back. Looks like the latest version (3.31.1) has that problem. You have "react-native-screens": "^3.29.0", try without '^'. Seemed to fix it for me right now.

I was facing the same problem, but removing the '^' from "react-native-screens": "^3.29.0" in package.json file solved the issue. Thank you @kristensala for providing the solution.

use this version "react-native-screens": "3.0.0",

For me its working after downgrading it to 3.0.0.

Thanks

from react-native-screens.

kristensala avatar kristensala commented on May 27, 2024 2

@tboba Yup. Android NDK is the problem. Solved. Thanks

from react-native-screens.

kkafar avatar kkafar commented on May 27, 2024 2

Hello 👋🏻 here come some conclusions

The error:

Error: Requiring module "node_modules/react-native-screens/src/index.tsx", which threw an exception: Error: Exception in HostObject::get(propName:RNSModule): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.app-MOOsrlTZxxpxhwDiZsIz2g==/base.apk"],nativeLibraryDirectories=[/data/app/com.app-MOOsrlTZxxpxhwDiZsIz2g==/lib/arm, /data/app/com.app-MOOsrlTZxxpxhwDiZsIz2g==/base.apk!/lib/armeabi-v7a, /system/lib, /product/lib]]] couldn't find "librnscreens.so"

Is indeed triggered by not present libscreens.so shared object and the fault is on library side, in particular these lines in our build.gradle which basically means that unless you are on React Native 0.71 or newer it won't be build, resulting in this runtime crash.

This issue is an oversight on our side as we should either change compatibility note or add some checks for RN version in runtime to avoid loading the dll into JVM.

Workarounds

If it is feasible in your situation / application you can upgrade React Native to 0.71 or newer and this should resolve the issue.

Another option is temporary downgrade and wait for fix on our side, however note that we are unsure yet on how to proceed with this issue (some technical constraints) and it might take a while. 3.29.0 should be the last unaffected version.

from react-native-screens.

Chandansharma1512 avatar Chandansharma1512 commented on May 27, 2024 1

I'm having the same (or a similar) issue.

Error: Exception in HostObject::get for prop 'RNSModule': java.lang.UnsatisfiedLinkError: dlopen failed: library "librnscreens.so" not found, js engine: hermes

ERROR TypeError: Cannot read property 'ScreenStack' of undefined

did you solve the issue?, I have the same problem.

from react-native-screens.

tboba avatar tboba commented on May 27, 2024 1

I've just checked provided reproducer with a slight modifications:

  • I've removed appcenter-related dependencies, since I was unable to run my examples with them
  • I've updated React Native to 0.70.15 version

Unfortunately, I still cannot reproduce this error. However, given the information that the error comes from librnscreens.so, I've got two suspicions there:

  • Could you check which version of Android NDK do you have installed? In my case, I'm using 26.1.10909125, but newer versions should be good to go aswell. That should be the first thing you should check 👍
  • If you're trying to use react-navigation's native-stack, are you trying to use goBackGesture prop? If so, please keep in mind that this prop is still not introduced there, since the PR with adding the API to native-stack is still open. For now, you can stick with the native-stack v5 (if possible).

from react-native-screens.

kristensala avatar kristensala commented on May 27, 2024 1

@kabundege I removed the If/else around ndkVersion and just added the ndkVersion = "26....."
It can have a bit of a snowball effect after. You might have to update other packages and/or react-native version itself

from react-native-screens.

kkafar avatar kkafar commented on May 27, 2024 1

Hey, we've found better way to handle this issue => should be solved with next release.

from react-native-screens.

github-actions avatar github-actions commented on May 27, 2024

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Description section.

from react-native-screens.

PhanithNoch avatar PhanithNoch commented on May 27, 2024

Same, did you solve it?

from react-native-screens.

kabundege avatar kabundege commented on May 27, 2024

Noo, am still trying to upgrade the project but it's hectic by using

  1. npx react-native upgrade or documents mutation through this guide
  2. creating a new app with the latest setup and moving the codebase to it

Same, did you solve it?

from react-native-screens.

kkafar avatar kkafar commented on May 27, 2024

Hello, can we get any more context here?

After what action this started to happen? Have done something particular like version upgrade or something?

Looking at the error message it looks that something failed at the build stage as the librnscreens.so was not created / is put in wrong place / is accessed too early?

It might be hard to help you w/o reproduction.

I would start with removing all the android & gradle caches and rebuilding from scratch. Try removing android/build, android/app/build, node_modules & possible global gradle caches.

from react-native-screens.

kabundege avatar kabundege commented on May 27, 2024

Hello, can we get any more context here?

After what action this started to happen? Have done something particular like version upgrade or something?

Looking at the error message it looks that something failed at the build stage as the librnscreens.so was not created / is put in wrong place / is accessed too early?

It might be hard to help you w/o reproduction.

I would start with removing all the android & gradle caches and rebuilding from scratch. Try removing android/build, android/app/build, node_modules & possible global gradle caches.

  1. after yarn install or yarn this started happening, no other kind of action was made
  2. Yes, librnscreens.so was probably removed by a recent change deployed
  3. i did all the clean possible to the point of recent a pc (starting fresh) gradle, java, yarn, ...

from react-native-screens.

kabundege avatar kabundege commented on May 27, 2024

here is the reproduction github-repo

from react-native-screens.

usar0v avatar usar0v commented on May 27, 2024

Hello, can we get any more context here?
After what action this started to happen? Have done something particular like version upgrade or something?
Looking at the error message it looks that something failed at the build stage as the librnscreens.so was not created / is put in wrong place / is accessed too early?
It might be hard to help you w/o reproduction.
I would start with removing all the android & gradle caches and rebuilding from scratch. Try removing android/build, android/app/build, node_modules & possible global gradle caches.

  1. after yarn install or yarn this started happening, no other kind of action was made
  2. Yes, librnscreens.so was probably removed by a recent change deployed
  3. i did all the clean possible to the point of recent a pc (starting fresh) gradle, java, yarn, ...

did you solve the problem?, I have the same problem, I tried everything?

from react-native-screens.

tboba avatar tboba commented on May 27, 2024

Hi everyone! Yeah, this looks like a missing librnscreens.so file. Could you check whether your project has reactNativeArchitectures property defined in gradle.properties file and that you're not running the project on device with different architecture than defined?

from react-native-screens.

alcidesbsilvaneto avatar alcidesbsilvaneto commented on May 27, 2024

I solved it just by using npm instead of yarn

from react-native-screens.

kabundege avatar kabundege commented on May 27, 2024

A workaround that proved effective for me was to "upgrade" my application to the most recent version. This involved generating a new application using npx react-native@latest init app_name, ensuring that react-native-screens functionality was operational (which it was), and subsequently transferring my entire codebase to this updated version.

I acknowledge that this solution may not be viable for everyone, but it's worth considering nonetheless.

from react-native-screens.

kabundege avatar kabundege commented on May 27, 2024

@kabundege Did you solve this problem? I am also facing this problem.

Yes i did, refer to this reply here

A workaround that proved effective for me was to "upgrade" my application to the most recent version. This involved generating a new application using npx react-native@latest init app_name, ensuring that react-native-screens functionality was operational (which it was), and subsequently transferring my entire codebase to this updated version.

I acknowledge that this solution may not be viable for everyone, but it's worth considering nonetheless.

from react-native-screens.

Dsalvat596 avatar Dsalvat596 commented on May 27, 2024

I'm having the same (or a similar) issue.
Error: Exception in HostObject::get for prop 'RNSModule': java.lang.UnsatisfiedLinkError: dlopen failed: library "librnscreens.so" not found, js engine: hermes
ERROR TypeError: Cannot read property 'ScreenStack' of undefined

did you solve the issue?, I have the same problem.

I actually solved it by updating my Kotlin version. Since I'm using Java jdk 17, i had to specify Kotlin 7.3.3 in gradle-wrapper.properties

from react-native-screens.

cleitoncsalvagni avatar cleitoncsalvagni commented on May 27, 2024

Started having the same problem couple days back. Looks like the latest version (3.31.1) has that problem. You have "react-native-screens": "^3.29.0", try without '^'. Seemed to fix it for me right now.

I was facing the same problem, but removing the '^' from "react-native-screens": "^3.29.0" in package.json file solved the issue. Thank you @kristensala for providing the solution.

use this version "react-native-screens": "3.0.0",

For me its working after downgrading it to 3.0.0.

Thanks

Works for me.

from react-native-screens.

tboba avatar tboba commented on May 27, 2024

Let me take a look on what might cause this error.

Also, just a note from me - I would highly not recommend using 3.0.0 version of react-native-screens and consider it as a solution. This version has been published 3 years ago and is probably incompatible with the newest versions of React Native. As a temporary solution, probably using 3.29.0 version should work though.

from react-native-screens.

kabundege avatar kabundege commented on May 27, 2024

@kristensala kindly share with us your android/build.gradle changes,
if it's where the NDK change were made.

buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 21
        compileSdkVersion = 32
        targetSdkVersion = 32

        if (System.properties['os.arch'] == "aarch64") {
            // For M1 Users we need to use the NDK 24 which added support for aarch64
            ndkVersion = "24.0.8215888" // over here
        } else {
            // Otherwise we default to the side-by-side NDK version from AGP.
            ndkVersion = "21.4.7075529" // & over here
        }
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.2.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("de.undercouch:gradle-download-task:5.0.1")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

from react-native-screens.

gui-grana avatar gui-grana commented on May 27, 2024

@kristensala I've downgraded RN Screens to 3.29.0 and it fixed my problem for now. Thank you!

from react-native-screens.

MurariCrimsonbeans avatar MurariCrimsonbeans commented on May 27, 2024

Started having the same problem couple days back. Looks like the latest version (3.31.1) has that problem. You have "react-native-screens": "^3.29.0", try without '^'. Seemed to fix it for me right now.

This fixed my problem

from react-native-screens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.