NativeActivity Sample : Error Unknown host 'jcenter.bintray.com' by using gradle experimental plugin

ⅰ亾dé卋堺 提交于 2019-12-13 19:03:50

问题


I tried building the nativeActivity code from the samples in Android Studio 1.5.1 but I am getting this error :

    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>

I didn't find this issue with the projects not using Experimental Plugin (com.android.tools.build:gradle-experimental:0.4.0') as used by all the Native samples from the android git hub.

my Project: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()
    }
}

回答1:


f you're unable to open this path

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

Using proxy try again.

  • run a proxy like freegate

  • the root path project in cmd type gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8580



来源:https://stackoverflow.com/questions/36027664/nativeactivity-sample-error-unknown-host-jcenter-bintray-com-by-using-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!