React - error: package expo.modules.updates does not exist

Viewed 3313

I ejected expo from my react project. But when I tried to run it on android I got an error saying

error: package expo.modules.updates does not exist

And it actually comes up from MainApplication.java on my android folder.

import expo.modules.constants.ConstantsPackage;
import expo.modules.permissions.PermissionsPackage;
import expo.modules.filesystem.FileSystemPackage;
import expo.modules.updates.UpdatesController;

I think expo not completely removed from my project. How do I resolve this issue? Thanks.

Edit : Here's my package.json maybe it can help.

{
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@babel/runtime": "^7.10.2",
    "@react-native-community/cli-platform-android": "^4.9.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/material-top-tabs": "^5.1.10",
    "axios": "^0.19.2",
    "moment": "^2.26.0",
    "native-base": "^2.13.12",
    "prop-types": "^15.7.2",
    "react": "~16.9.0",
    "react-dom": "16.11.0",
    "react-native": "~0.61.5",
    "react-native-cardview": "^2.0.5",
    "react-native-elements": "^2.0.0",
    "react-native-floating-labels": "^1.1.9",
    "react-native-gesture-handler": "^1.6.1",
    "react-native-gifted-chat": "^0.16.1",
    "react-native-hide-show-password-input": "^1.1.0",
    "react-native-image-header-scroll-view": "^0.10.3",
    "react-native-material-menu": "^1.1.3",
    "react-native-reanimated": "^1.8.0",
    "react-native-safe-area-context": "0.7.3",
    "react-native-screens": "^2.7.0",
    "react-native-tab-view": "^2.14.0",
    "react-native-unimodules": "~0.9.0",
    "react-native-vector-icons": "^6.6.0",
    "react-native-web": "~0.11.7",
    "react-navigation": "^4.3.9",
    "react-navigation-stack": "^2.3.13",
    "react-navigation-tabs": "^2.8.12",
    "realm": "^5.0.4"
  },
  "private": true,
  "devDependencies": {
    "@babel/core": "^7.9.6",
    "babel-jest": "~25.2.6",
    "jest": "~25.2.6",
    "react-test-renderer": "~16.9.0"
  }
}
3 Answers

Try to search in your android project for occurrences of expo.modules.*

I had a similar issue and found that there was a BasePackageList.java file that contained these references. Deleting the file solved it.

Also you could take a look at this link of a git commit removing expo from a RN project

did you remove expo-updates from your package.json?

Got the same issue, coming from this generated java file, deleting this file resolved the issue. BasePackageList.java

import java.util.Arrays;
import java.util.List;
import org.unimodules.core.interfaces.Package;

public class BasePackageList {
  public List<Package> getPackageList() {
    return Arrays.<Package>asList(
        new expo.modules.constants.ConstantsPackage(),
        new expo.modules.filesystem.FileSystemPackage(),
        new expo.modules.imageloader.ImageLoaderPackage(),
        new expo.modules.location.LocationPackage()
    );
  }
}

Try search expo.modules.* in the codebase as the other post suggested will help.

Related