React native old project build failed

Viewed 32

I am working in a old react native project. I am getting errors while running this app. How I can solve these errors. First time I am working in a old react native project. This app build in react native old version. I update this in to version. Please help me.

// My package.json ==>

    "name": "unknown",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "react-native start",
        "flow": "flow --show-all-errors",
        "flow start": "flow start",
        "flow stop": "flow stop",
        "flow status": "flow status",
        "flow coverage": "flow coverage",
        "eslint": "eslint",
        "eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
        "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
    },
    "dependencies": {
        "@react-native-community/cli-platform-android": "^9.1.0",
        "babel-plugin-transform-remove-console": "6.9.4",
        "braces": "^2.3.2",
        "crypto-js": "4.1.1",
        "currency-formatter": "1.5.9",
        "d3": "7.3.0",
        "d3-array": "3.1.1",
        "d3-scale": "4.0.2",
        "d3-shape": "3.1.0",
        "moment": "^2.29.4",
        "react": "^17.0.2",
        "react-dom": "^18.2.0",
        "react-native": "^0.69.5",
        "react-native-appstore-version-checker": "3.0.0",
        "react-native-device-info": "^10.1.1",
        "react-native-dropdownalert": "4.5.1",
        "react-native-elements": "3.4.2",
        "react-native-fabric": "^0.5.2",
        "react-native-fingerprint-scanner": "6.0.0",
        "react-native-gesture-handler": "^2.6.0",
        "react-native-keychain": "8.0.0",
        "react-native-loading-spinner-overlay": "3.0.0",
        "react-native-maps": "0.30.1",
        "react-native-modal-datetime-picker": "13.0.1",
        "react-native-pathjs-charts": "0.0.30",
        "react-native-segmented-control-tab": "4.0.0",
        "react-native-sentry": "0.43.2",
        "react-native-simple-dialogs": "1.4.0",
        "react-native-svg": "12.3.0",
        "react-native-table-component": "1.2.2",
        "react-native-vector-icons": "9.1.0",
        "react-navigation": "4.4.4",
        "react-redux": "7.2.6",
        "realm": "10.13.0",
        "redux": "4.1.2",
        "redux-logger": "3.0.6",
        "redux-thunk": "2.4.1"
    },
    "devDependencies": {
        "@babel/core": "7.17.5",
        "@babel/plugin-proposal-class-properties": "7.16.7",
        "@babel/plugin-transform-runtime": "7.17.0",
        "@babel/preset-env": "7.16.11",
        "@babel/preset-react": "7.16.7",
        "babel-cli": "6.26.0",
        "babel-eslint": "10.1.0",
        "babel-jest": "27.5.1",
        "babel-plugin-module-resolver": "4.1.0",
        "babel-preset-flow": "6.23.0",
        "babel-preset-react-native": "2.1.0",
        "eslint": "8.10.0",
        "eslint-config-airbnb": "^19.0.4",
        "eslint-config-prettier": "8.5.0",
        "eslint-import-resolver-babel-module": "5.3.1",
        "eslint-plugin-import": "2.25.4",
        "eslint-plugin-jsx-a11y": "6.5.1",
        "eslint-plugin-react": "7.29.3",
        "flow-bin": "0.173.0",
        "invariant": "2.2.4",
        "jest": "27.5.1",
        "metro-react-native-babel-preset": "0.69.0",
        "react-test-renderer": "17.0.2"
    },
    "jest": {
        "preset": "react-native"
    },
    "rnpm": {
        "assets": [
            "./assets/fonts/"
        ]
    }
}


//project level gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
        google()
        mavenCentral()
    }
    dependencies {
        
        classpath 'com.android.tools.build:gradle:7.2.1'
       
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

//My gradle.app file ==>

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:'
    }
}

apply plugin: "com.android.application"
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
    google()
}

When I try to run android app getting this below error->

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve project :realm.
     Required by:
         project :app
      > No matching configuration of project :realm was found. The consumer was configured to find a runtime of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.2.1' but:
          - None of the consumable configurations have attributes.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
0 Answers
Related