Home > Software design >  react native Could not find com.android.volley:volley:1.1.1
react native Could not find com.android.volley:volley:1.1.1

Time:11-24

I use react native 66 when run yarn android got the Error

yarn run v1.22.17 $ react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1428 file(s) to forward-jetify. Using 4 workers... info JS server already running. info Installing the app... Configure project :react-native-firebase react-native-firebase: using React Native prebuilt binary from /Users/ha3an/Documents/Bahrami/phone/homeserviceuser/node_modules/react-native/android WARNING:: The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.2. Android SDK Build Tools 30.0.2 will be used. To suppress this warning, remove "buildToolsVersion '28.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools. Task :app:checkDebugAarMetadata FAILED Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings 39 actionable tasks: 2 executed, 37 up-to-date FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:checkDebugAarMetadata'. Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.android.volley:volley:1.1.1. Searched in the following locations: - https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom - file:/Users/ha3an/.m2/repository/com/android/volley/volley/1.1.1/volley-1.1.1.pom - file:/Users/ha3an/Documents/Bahrami/phone/homeserviceuser/node_modules/react-native/android/com/android/volley/volley/1.1.1/volley-1.1.1.pom - file:/Users/ha3an/Documents/Bahrami/phone/homeserviceuser/node_modules/jsc-android/dist/com/android/volley/volley/1.1.1/volley-1.1.1.pom - https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom - https://www.jitpack.io/com/android/volley/volley/1.1.1/volley-1.1.1.pom Required by: project :app > project :react-native-google-places > com.google.android.libraries.places:places:1.1.0 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 25s

and build.qradle file is

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.2")
        classpath("com.google.gms:google-services:4.3.10")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

        google()
        maven { url 'https://www.jitpack.io' }
    }
}

i try use jcenter on my build.gradle file it's build successfully but got error

Error: ENOENT: no such file or directory, open '/.../phone/homeserviceuser/http:/localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.aloosalamati.homeserviceuser&modulesOnly=false&runModule=true'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at getCodeFrame (/.../phone/homeserviceuser/node_modules/metro/src/Server.js:919:18)
    at Server._symbolicate (/.../phone/homeserviceuser/node_modules/metro/src/Server.js:992:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Server._processRequest (/.../phone/homeserviceuser/node_modules/metro/src/Server.js:403:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/.../phone/homeserviceuser/http:/localhost:8081/index.bundle?platform=android&dev=true&minify=false&app=com.aloosalamati.homeserviceuser&modulesOnly=false&runModule=true'
}

i google it but can not find any solution for it

CodePudding user response:

i use jcenter and it's work fine

CodePudding user response:

you can add jcenter on your gradel.build file i think it's work

  • Related