flutter 运行失败

问题1

Launching lib\main.dart on Android SDK built for x86 64 in debug mode... Initializing gradle... Resolving dependencies... * Error running Gradle: ProcessException: Process "E:\ei-store\servergit\app\flutter_app\android\gradlew.bat" exited abnormally: > Configure project :app Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error. FAILURE: Build failed with an exception. * Where: Build file 'E:\ei-store\servergit\app\flutter_app\android\app\build.gradle' line: 26 * What went wrong: A problem occurred evaluating project ':app'. > Could not resolve all artifacts for configuration 'classpath'. > Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.2.0) > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.2.0/kotlin-reflect-1.2.0.jar'. > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.2.0/kotlin-reflect-1.2.0.jar'. > Remote host closed connection during handshake * 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 1m 20s Command: E:\ei-store\servergit\app\flutter_app\android\gradlew.bat app:properties Finished with error: Please review your Gradle project setup in the android/ folder.

  暂未找到具体原因,但是我设置file->Project Structure -> Project Settings -> Modules ->Dependecies-> 选上Flutter for Android和KotlinJavaRuntime,如下后就好了

 问题2

Launching lib\main.dart on Android SDK built for x86 64 in debug mode...
* Error running Gradle:
ProcessException: Process "E:\EI store\app\eistore\android\gradlew.bat" exited abnormally:

> Configure project :shared_preferences

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':shared_preferences'.
> Could not resolve all artifacts for configuration ':shared_preferences:classpath'.
   > Could not download guava.jar (com.google.guava:guava:22.0)
      > Could not get resource 'https://jcenter.bintray.com/com/google/guava/guava/22.0/guava-22.0.jar'.
         > Could not GET 'https://jcenter.bintray.com/com/google/guava/guava/22.0/guava-22.0.jar'.
            > Remote host closed connection during handshake
   > Could not download gson.jar (com.google.code.gson:gson:2.7)
      > Could not get resource 'https://jcenter.bintray.com/com/google/code/gson/gson/2.7/gson-2.7.jar'.
         > Could not GET 'https://jcenter.bintray.com/com/google/code/gson/gson/2.7/gson-2.7.jar'.
            > Remote host closed connection during handshake
   > Could not download kotlin-stdlib.jar (org.jetbrains.kotlin:kotlin-stdlib:1.2.0)
      > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.2.0/kotlin-stdlib-1.2.0.jar'.
         > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib/1.2.0/kotlin-stdlib-1.2.0.jar'.
            > Remote host closed connection during handshake
   > Could not download proguard-base.jar (net.sf.proguard:proguard-base:5.3.3)
      > Could not get resource 'https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.3.3/proguard-base-5.3.3.jar'.
         > Could not GET 'https://jcenter.bintray.com/net/sf/proguard/proguard-base/5.3.3/proguard-base-5.3.3.jar'.
            > Remote host closed connection during handshake
   > Could not download httpclient.jar (org.apache.httpcomponents:httpclient:4.2.6)
      > Could not get resource 'https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.2.6/httpclient-4.2.6.jar'.
         > Could not GET 'https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.2.6/httpclient-4.2.6.jar'.
            > Remote host closed connection during handshake
   > Could not download httpcore.jar (org.apache.httpcomponents:httpcore:4.2.5)
      > Could not get resource 'https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.2.5/httpcore-4.2.5.jar'.
         > Could not GET 'https://jcenter.bintray.com/org/apache/httpcomponents/httpcore/4.2.5/httpcore-4.2.5.jar'.
            > Remote host closed connection during handshake
   > Could not download commons-codec.jar (commons-codec:commons-codec:1.6)
      > Could not get resource 'https://jcenter.bintray.com/commons-codec/commons-codec/1.6/commons-codec-1.6.jar'.
         > Could not GET 'https://jcenter.bintray.com/commons-codec/commons-codec/1.6/commons-codec-1.6.jar'.
            > Remote host closed connection during handshake

* 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 1m 49s
  Command: E:\EI store\app\eistore\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
Exited (sigterm)

  

 

posted @ 2019-11-01 16:09  liehuofeihu  阅读(2378)  评论(0编辑  收藏  举报