简体   繁体   中英

FAILURE: A problem occurred configuring project ':path_provider'

There is no error in the command flutter doctor -v .

I tried deleting the path_provider_macos directory but it didn't work.

I updated the gradle plugin but it still didn't work.

I am getting this error both with vscode and android studio. I deleted and installed flutter sdk several times, but it still didn't work.

When I changed the gradle version to 3.3.0, I got a different error. it didn't work either.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'path_provider'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.analytics-library:shared:26.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.lint:lint-gradle-api:26.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:gradle-api:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > androidx.databinding:databinding-compiler-common:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools:sdk-common:26.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools:common:26.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools.build:manifest-merger:26.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools.analytics-library:tracker:26.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools:sdklib:26.3.0 > com.android.tools:repository:26.3.0
      > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.11/kotlin-stdlib-jdk8-1.3.11.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.11/kotlin-stdlib-jdk8-1.3.11.pom'.
               > Remote host terminated the handshake
   > Could not resolve org.ow2.asm:asm:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02
      > Could not resolve org.ow2.asm:asm:6.0.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm/6.0/asm-6.0.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm/6.0/asm-6.0.pom'.
               > Remote host terminated the handshake
   > Could not resolve org.ow2.asm:asm-analysis:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0
      > Could not resolve org.ow2.asm:asm-analysis:6.0.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
               > Remote host terminated the handshake
   > Could not resolve org.ow2.asm:asm-commons:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02
      > Could not resolve org.ow2.asm:asm-commons:6.0.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-commons/6.0/asm-commons-6.0.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-commons/6.0/asm-commons-6.0.pom'.
               > Remote host terminated the handshake
   > Could not resolve org.ow2.asm:asm-util:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02
      > Could not resolve org.ow2.asm:asm-util:6.0.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-util/6.0/asm-util-6.0.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/ow2/asm/asm-util/6.0/asm-util-6.0.pom'.
               > Remote host terminated the handshake
   > Could not resolve net.sf.jopt-simple:jopt-simple:4.9.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
      > Could not resolve net.sf.jopt-simple:jopt-simple:4.9.
         > Could not get resource 'https://repo.maven.apache.org/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.pom'.
               > Remote host terminated the handshake
   > Could not resolve net.sf.proguard:proguard-gradle:6.0.3.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0
      > Could not resolve net.sf.proguard:proguard-gradle:6.0.3.
         > Could not get resource 'https://repo.maven.apache.org/maven2/net/sf/proguard/proguard-gradle/6.0.3/proguard-gradle-6.0.3.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/net/sf/proguard/proguard-gradle/6.0.3/proguard-gradle-6.0.3.pom'.
               > Remote host terminated the handshake
   > Could not resolve com.squareup:javawriter:2.5.0.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
      > Could not resolve com.squareup:javawriter:2.5.0.
         > Could not get resource 'https://repo.maven.apache.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom'.
               > Remote host terminated the handshake
   > Could not resolve org.bouncycastle:bcpkix-jdk15on:1.56.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools:sdk-common:26.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools.build:apkzlib:3.3.0
      > Could not resolve org.bouncycastle:bcpkix-jdk15on:1.56.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/bouncycastle/bcpkix-jdk15on/1.56/bcpkix-jdk15on-1.56.pom'.
               > Remote host terminated the handshake
   > Could not resolve org.bouncycastle:bcprov-jdk15on:1.56.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools:sdk-common:26.3.0
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0 > com.android.tools.build:apkzlib:3.3.0
      > Could not resolve org.bouncycastle:bcprov-jdk15on:1.56.
         > Could not get resource 'https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.pom'.
            > Could not HEAD 'https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov-jdk15on-1.56.pom'.
               > Remote host terminated the handshake
   > Could not resolve org.ow2.asm:asm-tree:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.3.0 > com.android.tools.build:builder:3.3.0
      > Could not resolve org.ow2.asm:asm-tree:6.0.

Have you added permissions for read/write to external storage in android manifest.

if not, you need to add <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> in the android manifest file.

also you need to get run time permission before calling getExternalStorageDirectory(); for that you can use a package called permission_handler

I ran into this same issue first time connecting with a device, what you can do is if you app is working fine on web(I used chrome), then the issue is probably from packages. Flutter needs to download some packages, so just connect to the internet and try again. It might take some to finish downloading.

I had the same issue and by checking the conditions below it was running fine.

1-make sure your ide is running the app through your main file. 2-also use a good VPN.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM