10

Gradle Project Refresh Failedエラー:設定の依存関係を変更することはできません「:アプリ:_debugAnnotationProcessor」私はアプリレベルで<code>build.gradle</code>に<a href="https://github.com/flavioarfaria/KenBurnsView" rel="noreferrer">KenBurnsView</a>ライブラリを追加した後は、

を解決された後。私がgradleを同期しようとすると失敗しました。

build.gradle(アプリケーションレベル)

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 25 
buildToolsVersion "25.0.0" 
defaultConfig { 
    applicationId "com.sample.ac" 
    minSdkVersion 16 
    targetSdkVersion 24 
    versionCode 1 
    versionName "1.0_dev" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    jackOptions { 
     enabled true 
    } 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 

repositories { 
    jcenter() 
} 
compileOptions { 
    sourceCompatibility JavaVersion.VERSION_1_8 
    targetCompatibility JavaVersion.VERSION_1_8 
} 
} 

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.0.1' 
compile 'com.android.support:design:25.0.1' 
compile 'com.android.support:recyclerview-v7:25.0.1' 
compile 'com.android.support:cardview-v7:25.0.1' 

//ButterKnife for view injector 
compile 'com.jakewharton:butterknife:8.4.0' 
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' 

// EventBus for passing data between activities and fragments 
compile 'org.greenrobot:eventbus:3.0.0' 

//Material Loading Circular Progress Bar with white background 
compile 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE' 

//GSON for parsing JSON into Java Object and vice versa 
compile 'com.google.code.gson:gson:2.6.2' 

//For Image Loading from network 
compile 'com.github.bumptech.glide:glide:3.7.0' 

//SLiding up Panel Layout for Music Player 
compile 'com.sothree.slidinguppanel:library:3.3.0' 

//For Network Calling 
compile 'com.mcxiaoke.volley:library:1.0.19' 

//ViewPagerIndicator 
compile 'com.romandanylyk:pageindicatorview:0.0.7' 

//Google Play Services 
compile 'com.google.android.gms:play-services-auth:10.0.0' 
compile 'com.google.android.gms:play-services-plus:10.0.0' 
compile 'com.google.android.gms:play-services-identity:10.0.0' 
compile 'com.google.android.gms:play-services-base:10.0.0' 
compile 'com.google.android.gms:play-services-location:10.0.0' 
compile 'com.google.android.gms:play-services-maps:10.0.0' 
compile 'com.google.android.gms:play-services-gcm:10.0.0' 

//Ken Burns Effect for Image Background 
compile 'com.flaviofaria:kenburnsview:1.0.7' 

//Material Search View 
// compile 'com.miguelcatalan:materialsearchview:1.4.0' 
compile project(':searchlibrary') 

testCompile 'junit:junit:4.12' 

} 
apply plugin: 'com.google.gms.google-services' 

build.gradle(プロジェクトレベル)

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
repositories { 
    jcenter() 
    mavenCentral() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.2' 
    classpath 'com.google.gms:google-services:3.0.0' 

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

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

task clean(type: Delete) { 
delete rootProject.buildDir 
} 
+0

解決策を見つけましたか? –

+0

あなたは同じ問題に直面していますか? –

+1

同じエラーメッセージが表示されますが、別のライブラリを追加しようとすると、Jackと何か関係があると思います –

答えて

41

com.android」に依存関係を追加しようとしたとき、私はそれを得ました.support.constraint:constraint-layout:1.0.0-beta4 "とアンドロイドトレーニングクラスです。

@Scottが疑うように、私はそれを過ぎてしまい、ジャックを巻き込んだ。

ガットそれ以前:

  1. は、追加の依存関係をコメントアウト、jackOptionsは真のブロック、およびIは1.8との互換性を持っていたcompileOptionsブロックを、有効にしてください。
  2. 同期/クリーン/再構築/(それはどちらか、私はまだ学んでいる)のGradle
  3. コメントを外して追加の依存関係、同期を再構築するのGradle再び
  4. コメントを解除jackOptionsとcompileOptionsブロック、同期/再構築のGradle再び

その時点で、それは私のために働いた。

+0

ありがとうございます。出来た。これがどのように機能するのか教えていただけますか? –

+0

私は残念ながら言うことはできません。私は裏で何が起こっているのかよく知らない。 – kdawg

+3

アプリレベルのGradleファイルからjackOptionsとcompileOptionsを削除し、同期/ビルドしてから再び追加して同期/ビルドするだけで問題を解決できました。ジャックはいくつかの優れた機能を提供していますが、特にDagger 2のようなライブラリでは気になります(コンパイル時にNoMethodFoundエラーが発生する場合は完全なGuavaライブラリが含まれています)。 –

0

私はリポジトリ{...}と依存関係の依存関係{...}をモジュールのbuild.gradleに追加しました。

Android Studioがmavenリポジトリからの依存関係を読み込めないため、その理由がわかりました。代わりにコンパイルして、jarファイルをモジュールにコピーして同期させると、エラーは消えてしまいます。

要約すると、 "C:\ Users \ wjj.gradle \ caches \ modules-2 \ files-2.1"に依存関係がロードされているかどうかチェックすることができます。

私はそれがあなたを助けることを願っています!

4

アプリのbuild.gradleまたはプロジェクトbuild.moduleにそれを追加します。

repositories { 
    maven { 
     url 'https://maven.google.com' 
    } 
} 

私は「制約レイアウト」依存関係を追加し、私はoficalマニュアルで答えを見つけるときに私はこの問題を得る:https://developer.android.com/training/constraint-layout/index.html 私は思いますそれはあなたを助けるでしょう!

関連する問題

 関連する問題