2016-08-03 5 views
0

両方のMavenリポジトリを追加しようとしましたが、これを解決できないようです。
のGradle解決できませんでした:de.hdodenhof:circleimageview:2.1.0

にstackoverflowの上の任意の情報を見つけることができませんでしたし、依存関係を解決するための標準的な方法は何であると思いまし

ルートbuild.gradle

buildscript { 
    repositories { 
     mavenCentral() 
//  maven { url "https://mvnrepository.com/artifact/de.hdodenhof/circleimageview" } 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.2' 

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

故障したモジュールbuild.gradle

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.3.0' 
// compile files('libs/CircleImageView-master/gradle/wrapper/gradle-wrapper.jar') 
    compile 'de.hdodenhof:circleimageview:2.1.0' 
} 

解決するには:de.hdodenhof:circleimageview:2.1.0

答えて

0

compileの依存関係をrに追加しましたか? ight Gradle file? compile 'de.hdodenhof:circleimageview:2.1.0'行がdependencies {}ブロックにあり、そのブロックがプロジェクトのルートディレクトリではなく、モジュールフォルダにあるbuild.gradleファイルにあることを確認してください。

問題が解決しない場合は、コマンドラインから./gradlew clean --refresh-dependenciesを実行してみてください。

+0

うん、根を持つことになり、この

dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile project(":CircleImageView-master:circleimageview") ... } 

ような何かを行いますgradleにはリポジトリがあり、モジュールgradleには依存関係があります。私は私のメインポストを更新しました。 私はAndroid Studioでクリーンビルドを使用していますが、私はそれがgralew cleanと同等だと考えていますが、それを把握するとすぐにこれを試してみます。 –

+0

いいえ、それは似ていません。 '--refresh-dependencies'がGradleキャッシュを無効にし、すべての依存関係を再度ダウンロードするためです。 –

+0

Android Studioまたは –

1

質問に書かれているように、その依存関係をダウンロードできます。参考までに、私のプロジェクトのbuild.gradleはここにあります。私はあなたがallprojects作品が必要だと思います。私は依存関係がなければ解決できない問題がありました。

buildscript { 
    repositories { 
     jcenter() 
     mavenCentral() 
     mavenLocal() 
    } 

    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.2' 

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

allprojects { 
    repositories { 
     jcenter() 
     mavenCentral() 
     mavenLocal() 
    } 
} 

追加の注記:あなたはクローン化されたレポをコンパイルした場合、あなたはそれをsettings.gradleが

include ':app', ':CircleImageView-master:circleimageview' 
+1

私のプロキシではなく、WiFiホットスポットに接続するときに依存関係をコンパイルすることができたので、法人代理人 –

関連する問題