Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find native module 'ExpoTaskManager', js engine: hermes #28326

Closed
AhmedMannai10 opened this issue Apr 19, 2024 · 4 comments
Closed

Cannot find native module 'ExpoTaskManager', js engine: hermes #28326

AhmedMannai10 opened this issue Apr 19, 2024 · 4 comments
Labels
incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues Router expo-router

Comments

@AhmedMannai10
Copy link

Minimal reproducible example

  1. Install expo-background-fetch package using npm or yarn. 2. Import and use expo-background-fetch in the project code. 3. Run the project on an Android device or emulator.

Which package manager are you using? (Yarn is recommended)

yarn

If the issue is web-related, please select the bundler (web.bundler in the app.json)

None

Summary

"Cannot find native module 'ExpoTaskManager'" when attempting to use expo-background-fetch package in a React Native project

Environment

expo-env-info 1.2.0 environment info:
System:
OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 20.4.0 - /usr/local/bin/node
Yarn: 1.22.22 - /usr/local/bin/yarn
npm: 9.7.2 - /usr/local/bin/npm
SDKs:
Android SDK:
API Levels: 29, 30, 31, 33, 34
Build Tools: 29.0.2, 30.0.3, 33.0.1, 34.0.0
System Images: android-34 | Google APIs Intel x86_64 Atom
npmPackages:
expo: ~50.0.14 => 50.0.14
expo-router: ~3.4.8 => 3.4.8
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
react-native-web: ~0.19.6 => 0.19.10
npmGlobalPackages:
expo-cli: 6.3.10
Expo Workflow: bare

@AhmedMannai10 AhmedMannai10 added needs validation Issue needs to be validated Router expo-router labels Apr 19, 2024
@expo-bot expo-bot added incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues and removed needs validation Issue needs to be validated labels Apr 19, 2024
@expo-bot
Copy link
Collaborator

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

"I've only been able to reproduce it in private, proprietary code"

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

"I didn't have time to create one"

That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

"You can reproduce it by yourself by creating a project and following these steps"

This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

@gaisdav
Copy link

gaisdav commented Apr 22, 2024

same error

@AhmedMannai10
Copy link
Author

use this package instead
react-native-background-actions

@lachlanwp
Copy link

I get the same error in production, but not every time the app is opened. It seems to happen every couple of weeks in two of my apps, both which use expo-background-fetch.

I recently updated the apps to the newer versions. Before doing the update it wouldn't happen. I'd like to stay with Expo if possible! Happy to try to provide more info if required.

Packages and versions in my project:

    "react-native": "0.73.6",
    "expo": "^50.0.0",
    "expo-application": "^5.8.3",
    "expo-background-fetch": "^11.8.1",
    "expo-constants": "^15.4.5",
    "expo-location": "^16.5.5",
    "expo-permissions": "^14.4.0",
    "expo-task-manager": "^11.7.2",

It's been very hard to find steps to reproduce the issue and I've been monitoring it now for at least a month. I've tried lots of different things to try to get it to fire off.

Here's my stack trace:

com.facebook.react.common.JavascriptException: Error: Cannot find native module 'ExpoTaskManager', js engine: hermes, stack:
requireNativeModule@1:1890401
anonymous@1:1896936
loadModuleImplementation@1:79637
guardedLoadModule@1:78871
metroRequire@1:78154
anonymous@1:1894877
loadModuleImplementation@1:79637
guardedLoadModule@1:78871
metroRequire@1:78154
anonymous@1:1883774
loadModuleImplementation@1:79637
guardedLoadModule@1:78871
metroRequire@1:78154
anonymous@1:1880301
loadModuleImplementation@1:79637
guardedLoadModule@1:78871
metroRequire@1:78154
anonymous@1:1241798
loadModuleImplementation@1:79637
guardedLoadModule@1:78871
metroRequire@1:78154
anonymous@1:89607
loadModuleImplementation@1:79637
guardedLoadModule@1:78828
metroRequire@1:78154
global@1:77089

        at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:65)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:149)
        at com.facebook.jni.NativeRunnable.run(NativeRunnable.java:-2)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loopOnce(Looper.java:226)
        at android.os.Looper.loop(Looper.java:313)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:234)
        at java.lang.Thread.run(Thread.java:1012)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues Router expo-router
Projects
None yet
Development

No branches or pull requests

4 participants