0

I am trying to build a simple react native app by using expo android app but I am getting these 2 error log always - Module AppRegistry is not a registered callable module and Cant find variable: Constants.

import React, { Component } from "react";
import { StyleSheet, Text, View, Image } from "react-native";

export default class App extends Component {
  render() {
    return (

      <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
        <Text>Hello, world!</Text>
      </View>
    );
  }
}

I am using my mobile hotspot in my laptop.

Abhishek Konnur
  • 503
  • 1
  • 9
  • 33

1 Answers1

0

I wrote the answer by referring to this link.

here

  1. cd android
  2. sudo ./gradlew clean
  3. then back to the working directory and run react-native run-android

you should restart your npm too after that upgrade.

and

delete the Constant usage in the program.

import android.provider.SyncStateContract.Constants.ConstantName

This will cause the Can not find Constants error to disappear.

I hope this will solve your problem.

hong developer
  • 13,291
  • 4
  • 38
  • 68