Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/330.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.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
Java 渐变同步问题:无法获取“;kotlin-stdlib-jdk8-1.4.30.pom“;_Java_Android_Android Studio_Kotlin_Gradle - Fatal编程技术网

Java 渐变同步问题:无法获取“;kotlin-stdlib-jdk8-1.4.30.pom“;

Java 渐变同步问题:无法获取“;kotlin-stdlib-jdk8-1.4.30.pom“;,java,android,android-studio,kotlin,gradle,Java,Android,Android Studio,Kotlin,Gradle,当“Gradle sync”启动时,我在Android Studio中遇到以下错误: 无法获取'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.30/kotlin-stdlib-jdk8-1.4.30.pom'. 从服务器收到状态代码403:禁止 禁用渐变“脱机模式”和同步项目 它下载了几个文件,然后卡在同一个文件上kotlin-stdlib-jdk8-1.4.30.pom,并显示上面的错误。 我尝试

当“Gradle sync”启动时,我在Android Studio中遇到以下错误:
无法获取'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.4.30/kotlin-stdlib-jdk8-1.4.30.pom'. 从服务器收到状态代码403:禁止 禁用渐变“脱机模式”和同步项目
它下载了几个文件,然后卡在同一个文件上
kotlin-stdlib-jdk8-1.4.30.pom
,并显示上面的错误。
我尝试过几种解决方案,如和,但没有一种能真正解决问题。
既然我只使用Java,为什么Android studio应该关心kotlin,我能做些什么来避免与kotlin打交道呢?
这是gradle>build.gradle文件:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        //classpath "com.android.tools.build:gradle:4.1.3"
        classpath 'com.android.tools.build:gradle:+'
        classpath 'com.google.gms:google-services:4.2.0'

    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.myapplication_10"
        minSdkVersion 29
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    classpath 'com.android.tools.build:gradle:+'
    classpath 'com.google.gms:google-services:4.2.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
这是app>src>build.gradle文件:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        //classpath "com.android.tools.build:gradle:4.1.3"
        classpath 'com.android.tools.build:gradle:+'
        classpath 'com.google.gms:google-services:4.2.0'

    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.myapplication_10"
        minSdkVersion 29
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    classpath 'com.android.tools.build:gradle:+'
    classpath 'com.google.gms:google-services:4.2.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

403禁止通常意味着你是从一个受到美国制裁的国家(例如伊朗)连接的。尝试清理project,清除Gradle缓存,退出android studio,连接到VPN以更改计算机的IP,打开studio并同步/运行。还有一些服务,如Shecan或Begzar可能会有所帮助。

我使用“gradlew cleanBuildCache”清理了我的项目,然后重新启动,不幸的是没有任何更改。我正在使用Psiphon,我应该使用其他东西还是尝试特定的连接设置?我已经好几年没有使用Psiphon了,所以我对此一无所知。但她可以试试,它过去是有用的。此外,如果您对vpn服务器有一些了解,那么在您的国家之外获得一个VPS并在其上安装Shadowsocks/OpenVPN并为自己使用该vpn是值得的:DI移动到质子vpn,错误消失了,非常感谢。