1

我尝试从 Android Studio 1.5.1 中的示例构建 nativeActivity 代码,但出现此错误:

    Error:Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle.
   Enable Gradle 'offline mode' and sync 
   Learn about configuring HTTP proxies in Gradle</a>

我没有发现项目没有使用(com.android.tools.build:gradle-experimental:0.4.0')来自 android git hub 的所有本机示例所使用的 Experimental Plugin 的问题。

我的项目:NativeActivity build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
       jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle-experimental:0.4.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
4

1 回答 1

0

如果您无法打开此路径

https://bintray.com/android/android-tools/com.android.tools.build.gradle-experimental/0.4.0/view#files/com/android/tools/build/gradle-experimental

使用代理重试。

  • 运行像自由门这样的代理

  • cmd类型的根路径项目gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8580

于 2016-03-16T06:04:53.007 回答