2017-12-04 6 views
0

私はアンドロイド開発を始めました。誰かが私を助けてくれることを願って。「hello world」を試してみると、Androidスタジオ3の問題

私はAndroid Studio 3.0.1を試していて、 "Hello world"としてプロジェクトを作成しようとしています。すべての手順はデフォルト設定に従います。

しかし、プロジェクトのビルドに失敗しました。エラーメッセージには、

の依存関係を解決できません: 'app @ debug/compileClasspath':com.android.support:appcompat-v7:26.1.0を解決できませんでした。

com.android.support:appcompat-v7:26.1.0を解決できませんでした。 必須: プロジェクト:アプリ com.android.support:appcompat-v7:26.1.0を解決できませんでした。 リソース 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'を取得できませんでした。 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'を取得できませんでした。 接続が[dl.google.com/127.0.1.4]失敗dl.google.com:443する:接続が拒否されました: 接続の接続を拒否した:私はグーグルとstackoverflowの中を探索し

を接続します。アンドロイドStudioでそれを言って、いくつかのヒントがあります3.0+私は、リポジトリのセクションと依存関係セクションとのbuild.gradleファイルを変更する必要がありますhttps://developer.android.com/topic/libraries/support-library/setup.html

allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url "https://maven.google.com" 
     } 
    } 
} 

をそして私はそれをしました。ここで

は私のトップレベルのbuild.gradleファイルです:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 
buildscript { 
    repositories { 
     google() 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:3.0.1' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 
allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url "https://maven.google.com" 
     } 
    } 
} 
task clean(type: Delete) { 
delete rootProject.buildDir 
} 

そしてここでは、私のアプリ/ build.gradleファイルです:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    defaultConfig { 
     applicationId "com.example.android.happybirthday" 
     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' 
    implementation 'com.android.support:design:26.1.0' 
    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' 
    compile 'com.android.support:appcompat-v7:26.1.0' 
} 

その後、私はエラーメッセージが表示されました':app @ debug/compileClasspath'の依存関係を解決できません:com.android.support:appcompat-v7:26.1.0を解決できませんでした。

com.android.support:appcompat-v7:26.1.0を解決できませんでした。 必須: プロジェクト:アプリ com.android.support:appcompat-v7:26.1.0を解決できませんでした。 リソース 'https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'を取得できませんでした。 'https://jcenter.bintray.com/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom'を取得できませんでした。 接続が[jcenter.bintray.com/127.0.1.2]失敗jcenter.bintray.com:443する:接続が拒否されました: 接続の接続を拒否した:私はプロキシ接続を使用していますが、ネットワークは、[OK]をする必要があり

を接続。

誰かが私にガイドを与えることができれば感謝します。ありがとう。

+1

更新SDKツール – sasikumar

+0

どうすればいいですか? – Zong

+0

ツール--->アンドロイド---> sdkマネージャー – sasikumar

答えて

0

アプリ/ビルドから

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' 

にこれらの行を削除してみてください。プロジェクトをクリーンアップする - >再構築する これは役に立ちます

+0

@Omiに感謝しています。私はこれらの3行にコメントしましたが、それと同じエラーメッセージです。 – Zong

関連する問題