Georgios Kourounis
Georgios Kourounis

Reputation: 29

Error: Cannot find native module 'ExpoLocalAuthentication', js engine: hermes

I'm having this error after trying to use expo-local-authentication

This is my app.json

{
  "expo": {
    "name": "gctimes_app",
    "slug": "gctimes_app",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "googleServicesFile": "./google-services.json",
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon.png",
        "backgroundColor": "#ffffff"
      },
      "package": "com.example.example_app"
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "extra": {
      "eas": {
        "projectId": "project_id"
      }
    }
  }
}

And this is my package.json

{
  "name": "gctimes_app",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo/vector-icons": "^13.0.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-firebase/analytics": "^18.5.0",
    "@react-native-firebase/app": "^18.5.0",
    "@react-native-firebase/messaging": "^18.5.0",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/stack": "^6.3.17",
    "axios": "^1.5.0",
    "base-64": "^1.0.0",
    "expo": "~49.0.8",
    "expo-dev-client": "~2.4.11",
    "expo-font": "^11.4.0",
    "expo-splash-screen": "~0.20.5",
    "expo-status-bar": "~1.6.0",
    "i18next": "^23.5.1",
    "react": "18.2.0",
    "react-i18next": "^13.2.2",
    "react-native": "0.72.4",
    "react-native-date-picker": "^4.3.3",
    "react-native-date-ranges": "^2.5.0",
    "react-native-dropdown-picker": "^5.4.6",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-paper": "^5.10.6",
    "react-native-reanimated": "^3.5.2",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-table-component": "^1.2.2",
    "react-native-vector-icons": "^10.0.0",
    "uuid": "^9.0.1",
    "expo-local-authentication": "~13.4.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0"
  },
  "private": true
}

I'm trying it after building a development build using expo and running it on my physical device.

I've also tried to build a new build but I get this error during Run gradlew

A problem occurred evaluating project ':expo-local-authentication'.

[stderr]

Could not set unknown property 'classifier' for task ':expo-local-authentication:androidSourcesJar' of type org.gradle.api.tasks.bundling.Jar.

Upvotes: 2

Views: 1941

Answers (1)

Robin
Robin

Reputation: 1

You need to add the plugin to app.json before rebuilding

{
  "expo": {
    "plugins": [
      [
        "expo-local-authentication",
        {
          "faceIDPermission": "Allow $(PRODUCT_NAME) to use Face ID."
        }
      ]
    ]
  }
}

Upvotes: 0

Related Questions