Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android studio 编译颤振应用程序时出错_Android Studio_Flutter - Fatal编程技术网

Android studio 编译颤振应用程序时出错

Android studio 编译颤振应用程序时出错,android-studio,flutter,Android Studio,Flutter,我正试图在android studio 3.5版本中运行我的颤振应用程序,但我无法做到。我升级了Flitter并重新安装了android studio。我使缓存失效并重新启动,但没有解决我的问题。我尝试使用VisualStudio代码,但得到了相同的错误。下面你可以看到我得到的错误 有人知道如何解决这个问题吗?我的android studio以前工作得很好,但不确定这是在更新之后还是什么 FAILURE: Build failed with an exception. * What went

我正试图在android studio 3.5版本中运行我的颤振应用程序,但我无法做到。我升级了Flitter并重新安装了android studio。我使缓存失效并重新启动,但没有解决我的问题。我尝试使用VisualStudio代码,但得到了相同的错误。下面你可以看到我得到的错误

有人知道如何解决这个问题吗?我的android studio以前工作得很好,但不确定这是在更新之后还是什么

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
     Required by:
         project :
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
         > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
               > Remote host closed connection during handshake
   > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.41.
     Required by:
         project : > com.android.tools.build:gradle:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.lint:lint-gradle-api:26.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:gradle-api:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > androidx.databinding:databinding-compiler-common:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools:sdk-common:26.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools:common:26.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools.build:manifest-merger:26.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools.analytics-library:tracker:26.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools:sdklib:26.5.0 > com.android.tools:repository:26.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools:sdk-common:26.5.0 > com.android.tools.analytics-library:shared:26.5.0
      > Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.41.
         > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.41/kotlin-stdlib-jdk8-1.3.41.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.41/kotlin-stdlib-jdk8-1.3.41.pom'.
               > Remote host closed connection during handshake
   > Could not resolve org.ow2.asm:asm:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04
      > Could not resolve org.ow2.asm:asm:6.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm/6.0/asm-6.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm/6.0/asm-6.0.pom'.
               > Remote host closed connection during handshake
   > Could not resolve org.ow2.asm:asm-analysis:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.5.0
      > Could not resolve org.ow2.asm:asm-analysis:6.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm-analysis/6.0/asm-analysis-6.0.pom'.
               > Remote host closed connection during handshake
   > Could not resolve org.ow2.asm:asm-commons:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04
      > Could not resolve org.ow2.asm:asm-commons:6.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-commons/6.0/asm-commons-6.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm-commons/6.0/asm-commons-6.0.pom'.
               > Remote host closed connection during handshake
   > Could not resolve org.ow2.asm:asm-util:6.0.
     Required by:
         project : > com.android.tools.build:gradle:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04
      > Could not resolve org.ow2.asm:asm-util:6.0.
         > Could not get resource 'https://jcenter.bintray.com/org/ow2/asm/asm-util/6.0/asm-util-6.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/ow2/asm/asm-util/6.0/asm-util-6.0.pom'.
               > Remote host closed connection during handshake
   > Could not resolve net.sf.jopt-simple:jopt-simple:4.9.
     Required by:
         project : > com.android.tools.build:gradle:3.5.0
         project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0
      > Could not resolve net.sf.jopt-simple:jopt-simple:4.9.
         > Could not get resource 'https://jcenter.bintray.com/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.pom'.
            > Could not GET 'https://jcenter.bintray.com/net/sf/jopt-simple/jopt-simple/4.9/jopt-simple-4.9.pom'.
               > Remote host closed connection during handshake

我的身材,格雷德尔是

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.erod.xform_master"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

而app/build.gradle是

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.erod.xform_master"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}


首先,在cmd中检查你的颤振医生,看看一切正常,然后,当你在android studio中创建一个新的颤振项目时,默认情况下不要使用kotlin或java作为lenguague,不要在它们上标记任何内容,只是让它们为空

首先,在cmd中检查你的颤振医生,看看一切正常,在那之后,当你在android studio中创建一个新的Flitter项目时,默认情况下不要使用kotlin或java作为lenguague,不要在它们上标记任何内容,只是让它们为空

请在问题中添加两个build.gradle文件我将build.gradle添加到我的原始帖子我怀疑系统无法访问Internet我也有同样的问题请在问题中添加两个build.gradle文件我将build.gradle添加到我的原始帖子我怀疑系统正在运行无法上网我也有同样的问题