Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.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_Android Gradle Plugin - Fatal编程技术网

新安装的android studio没有';不要构建新的应用程序

新安装的android studio没有';不要构建新的应用程序,android,android-gradle-plugin,Android,Android Gradle Plugin,我似乎不知道发生了什么事 我刚在我的新笔记本电脑上安装了android studio 3, 我做所有的下载,我下载了JDK 8 一切似乎都很好。然后,我创建了一个全新的应用程序,构建过程开始了,但由于所有依赖项而失败,我下载了所有正确的SDK平台,以及下载的SDK工具 但这是来自gradle sync的消息: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve juni

我似乎不知道发生了什么事

我刚在我的新笔记本电脑上安装了android studio 3, 我做所有的下载,我下载了JDK 8

一切似乎都很好。然后,我创建了一个全新的应用程序,构建过程开始了,但由于所有依赖项而失败,我下载了所有正确的SDK平台,以及下载的SDK工具

但这是来自gradle sync的消息:

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve junit:junit:4.12.


Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.


Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. 


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test.espresso:espresso-core:3.0.1. 


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test:runner:1.0.1.
这是我的
Build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.test.testapp"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
这是我的
Build.gradle
项目:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
我不确定这个问题,因为我有一台运行完全相同版本的android studio的PC,它可以正常工作

有什么我可能遗漏的吗

如果我需要显示更多设置,请告诉我,但这只是一个新安装

编辑:我刚刚运行了clean项目,现在收到了以下消息:

Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.android.support:appcompat-v7:26.1.0.
  Required by:
      project :app
   > Could not resolve com.android.support:appcompat-v7:26.1.0.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
            > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve com.android.support:appcompat-v7:26.1.0.
      > Could not get resource 'https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
         > Could not GET 'https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'.
            > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

在我看来,由于以下错误,Android Studio无法从存储库中获取依赖项:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

您是否有工作的直接互联网连接?没有代理?您能像使用浏览器一样访问SSL站点吗?

我认为这是一个internet连接问题。。。您可以先查看。

谢谢!我注意到webiste上的测试失败了,这是一台工作笔记本电脑,所以我会和我的管理员谈谈看。非常感谢你!