10

Gradle Project Refresh FailedОшибка: Не удается изменить зависимости от конфигурации «: приложение: _debugAnnotationProcessor» после того, как она была решена

После того как я добавил KenBurnsView Библиотеку build.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

Nope. Вы сталкиваетесь с одной и той же проблемой? –

+1

Я получаю то же сообщение об ошибке, но при попытке добавить другую библиотеку, я думаю, что это как-то связано с Джеком –

ответ

41

Я получил его при попытке добавить зависимость к «com.android .support.constraint: constraint-layout: 1.0.0-beta4 "для учебного класса android.

Мне удалось пройти мимо него, и это связано с Джеком, как подозревал @Scott.

Got мимо него:

  1. закомментировав добавляемые зависимость, то jackOptions включить истинный блок, и блок compileOptions, где у меня было совместимо с 1.8.
  2. Sync/Clean/Rebuild Gradle (в зависимости от того, что это, я все еще учусь)
  3. Раскомментирует добавил зависимостей, синхронизации/восстановление Gradle снова
  4. раскомментируйте jackOptions и compileOptions блоков, синхронизации/восстановление Gradle снова

В этот момент это сработало для меня.

+0

Спасибо человеку. Это сработало. Можете ли вы рассказать мне, как это работает? –

+0

Что я не могу сказать, к сожалению. Я не знаком с тем, что происходит за кулисами. – kdawg

+3

Мне удалось преодолеть проблему, просто удалив jackOptions и compileOptions из файла Gradle на уровне приложения, синхронизируйте/создайте, затем добавьте обратно и синхронизируйте/создайте.Джек действительно предлагает некоторые хорошие возможности, но я устал от того, что он был темпераментным, особенно с такими библиотеками, как Dagger 2 (для которых я имею в виду полную библиотеку Guava, иначе я получаю ошибку NoMethodFound при компиляции). –

0

Я тоже сталкиваюсь с этим вопросом, я добавил maven в репозитории {...} и зависимость в зависимостях {...} от build.gradle модуля.

Я нахожу причину, потому что Android Studio не может загрузить зависимость из репозитория maven. затем вместо этого компилируйте, я копирую банку в модуль, синхронизирую, ошибка исчезает.

Таким образом, вы можете проверить, загружена зависимость или нет: «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 Я думаю, это поможет вам!