我几个月来一直在研究一个项目没有问题。就在今天,在Android Studio中重新打开了该项目并开始收到错误:
Gradle sync failed: Failed to notify project evaluation listener.
我还清理了缓存,重建项目,重新启动了我的电脑,在SDK中卸载并重新安装了Android支持和Google库,并尝试使用Invalidate Cache并重新启动。这些都不起作用。
我正在使用Android Studio 2.1.1,以防万一。
我希望有人可以帮我解决这个问题。提前谢谢。
LOG:
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:55)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy10.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
... 94 more
Caused by: java.lang.StackOverflowError
at com.google.common.base.Objects.hashCode(Objects.java:78)
at com.android.build.gradle.internal.dependency.LibraryDependencyImpl.hashCode(LibraryDependencyImpl.java:145)
at com.google.common.collect.AbstractMapBasedMultimap.put(AbstractMapBasedMultimap.java:192)
at com.google.common.collect.AbstractListMultimap.put(AbstractListMultimap.java:100)
at com.google.common.collect.ArrayListMultimap.put(ArrayListMultimap.java:66)
at com.android.build.gradle.internal.DependencyManager.addDependency(DependencyManager.java:807)
at com.android.build.gradle.internal.DependencyManager.addDependency(DependencyManager.java:855)
at com.android.build.gradle.internal.DependencyManager.addDependency(DependencyManager.java:855)
at com.android.build.gradle.internal.DependencyManager.addDependency(DependencyManager.java:855)
2016-05-29 15:34:00,668 [ 193987] WARN - nal.AbstractExternalSystemTask - Failed to notify project evaluation listener.
com.intellij.openapi.externalSystem.model.ExternalSystemException: Failed to notify project evaluation listener.
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:106)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:158)
at org.jetbrains.plugins.gradle.service.project.BaseGradleProjectResolverExtension.getUserFriendlyError(BaseGradleProjectResolverExtension.java:457)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:350)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:373)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:339)
at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:230)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:97)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:65)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:419)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:500)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
2016-05-29 15:34:00,683 [ 194002] WARN - radle.project.ProjectSetUpTask -
2016-05-29 15:34:00,683 [ 194002] INFO - radle.project.ProjectSetUpTask - Failed to notify project evaluation listener.
Consult IDE log for more details (Help | Show Log)
2016-05-29 15:34:00,683 [ 194002] INFO - ls.idea.gradle.GradleSyncState - Sync with Gradle for project 'IconShowcase' failed: Failed to notify project evaluation listener.
Consult IDE log for more details (Help | Show Log)
2016-05-29 15:34:00,902 [ 194221] INFO - #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2016-05-29 15:34:00,969 [ 194288] INFO - #com.jetbrains.cidr.lang - Loading symbols finished in 0 s.
2016-05-29 15:34:01,016 [ 194335] INFO - #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2016-05-29 15:34:01,016 [ 194335] INFO - #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
项目结构
app build.gradle
apply plugin: 'com.android.application'
repositories {
maven { url "https://jitpack.io" }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "jahirfiquitiva.apps.iconshowcase.sample"
minSdkVersion 16
targetSdkVersion 23
versionCode 10
versionName "1.0"
generatedDensities = []
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
sourceSets {
main {
res.srcDirs = [
'src/main/res',
'src/main/res/drawable',
'src/main/res/drawable/dashboard',
'src/main/res/drawable/designer',
'src/main/res/drawable/icon_pack',
'src/main/res/drawable/launchers_icons',
'src/main/res/drawable/widgets',
'src/main/res/values',
'src/main/res/values/icon_pack',
'src/main/res/values/configuration'
]
}
}
buildTypes {
release {
minifyEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
themeMode {} //themeMode for testing
standard {} //standard testing without themeMode stuff
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile project(':library')
}
library build.gradle
buildscript {
repositories {
mavenCentral()
}
}
apply plugin: 'com.android.library'
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 10
versionName "1.0"
generatedDensities = []
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
sourceSets {
main {
res.srcDirs = [
'src/main/res',
'src/main/res/drawable',
'src/main/res/drawable/dashboard',
'src/main/res/drawable/designer',
'src/main/res/drawable/icon_pack',
'src/main/res/drawable/launchers_icons',
'src/main/res/drawable/splash_screens',
'src/main/res/drawable/widgets',
'src/main/res/layout',
'src/main/res/layout/activities',
'src/main/res/layout/extras',
'src/main/res/layout/items',
'src/main/res/layout/sections',
'src/main/res/layout/widgets',
'src/main/res/values/icon_pack',
'src/main/res/values/configuration',
'src/main/res/values/texts'
]
}
}
buildTypes {
release {
minifyEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
aaptOptions {
noCompress 'zip', 'komp', 'klwp', 'kwgt', 'klck', 'kwch'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0@aar'
compile 'com.android.support:support-v4:23.4.0@aar'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0@aar'
compile 'com.android.support:recyclerview-v7:23.4.0@aar'
compile 'com.android.support:palette-v7:23.4.0@aar'
compile 'com.android.support:gridlayout-v7:23.4.0'
compile 'com.android.support:customtabs:23.4.0'
//Material Dialogs
compile('com.github.afollestad.material-dialogs:core:0.8.5.9@aar') {
transitive = true
}
//Material Drawer
compile('com.mikepenz:materialdrawer:5.2.7@aar') {
transitive = true
}
//OkHttp
compile 'com.squareup.okhttp3:okhttp:3.3.1'
//Glide Library - Image Loading Lib
compile 'com.github.bumptech.glide:glide:3.8.0-SNAPSHOT'
//Sectioned RecyclerView
compile('com.afollestad:sectioned-recyclerview:0.2.2') {
transitive = true
}
compile 'com.truizlop.sectionedrecyclerview:library:1.1.0'
//Muzei API
//noinspection GradleDynamicVersion
compile 'com.google.android.apps.muzei:muzei-api:2.+'
//Circular Image View
compile 'de.hdodenhof:circleimageview:2.0.0'
//RecyclerView Fast Scroller
compile 'com.github.pluscubed:recycler-fast-scroll:0.3.1@aar'
//Donations Lib
compile 'org.sufficientlysecure:donations:2.4'
//License Checker Lib
compile 'com.github.javiersantos:PiracyChecker:0.0.2'
//Required for better Zooper setup
compile 'io.reactivex:rxandroid:1.1.0'
//Required for Kustom support.
//noinspection GradleDynamicVersion
compile 'org.bitbucket.frankmonza:kustomapi:+'
}
settings.gradle
include ':app', ':library'
答案 0 :(得分:5)
当我移动到更高级别的gradle时,我遇到了类似的问题。找到了答案here。尝试更改gradle级别 就我而言,这个版本有帮助
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
而且这个等级版本会抛出错误
'com.android.tools.build:gradle:2.2.2'
'com.android.tools.build:gradle:3.0.0'
请不要忘记在gradle-wrapper.properties中更改distributionUrl
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
答案 1 :(得分:1)
通过将MaterialDialogs lib版本更改为
来解决此问题compile('com.afollestad.material-dialogs:core:0.8.5.9@aar') { transitive = true }
答案 2 :(得分:0)
我从GitHub下载了一个旧的存储库,并尝试更新某些版本。然后得到这个错误。我退回
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-all.zip
按照@Kamila的建议,错误消失了。