Aujourd'hui, j'ai mis à jour mon studio Android vers la version 3.2 et lorsque j'essaie de construire la gradle
. Je reçois une erreur en dessous. S'il vous plaît quelqu'un peut m'aider à ce sujet.
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.Java:94)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.Java:89)
at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.Java:70)
at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.Java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.Java:110)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.Java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:110)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.Java:50)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.Java:667)
at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.Java:136)
at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.Java:35)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.Java:62)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.Java:38)
at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.Java:261)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.Java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:110)
at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.Java:173)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.Java:132)
at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.Java:110)
at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.Java:87)
at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.Java:84)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.Java:152)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.Java:100)
at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.Java:84)
at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.Java:64)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.Java:35)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.Java:35)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.Java:32)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.Java:43)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.Java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:110)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.Java:40)
at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.Java:51)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.Java:49)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.Java:32)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.Java:39)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.Java:25)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.Java:80)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.Java:53)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.Java:57)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.Java:32)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.Java:36)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.Java:25)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.Java:43)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.Java:29)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.Java:64)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.Java:29)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.Java:59)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.Java:44)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.Java:45)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.Java:30)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.Java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.Java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.Java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.Java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.Java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.Java:72)
at org.gradle.util.Swapper.swap(Swapper.Java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.Java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.Java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.Java:62)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.Java:82)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:122)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.Java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.Java:295)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.Java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.Java:46)
at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.Java:55)
at Java.lang.Thread.run(Thread.Java:745)
Caused by: org.gradle.internal.event.ListenerNotificationException: Failed to notify project evaluation listener.
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.Java:86)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.Java:324)
at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.Java:234)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.Java:140)
at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.Java:37)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.Java:93)
at com.Sun.proxy.$Proxy30.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.Java:76)
... 85 more
Caused by: Java.lang.NoClassDefFoundError: com/Android/ide/common/res2/ResourceSet
at org.jetbrains.kotlin.gradle.plugin.Android25ProjectHandler.getResDirectories(Android25ProjectHandler.kt:185)
at org.jetbrains.kotlin.gradle.plugin.Android25ProjectHandler.getResDirectories(Android25ProjectHandler.kt:21)
at org.jetbrains.kotlin.gradle.internal.AndroidSubplugin$applyExperimental$3.invoke(AndroidSubplugin.kt:172)
at org.jetbrains.kotlin.gradle.internal.AndroidSubplugin$applyExperimental$3.invoke(AndroidSubplugin.kt:76)
at org.jetbrains.kotlin.gradle.plugin.Android25ProjectHandlerKt$sam$Action$449ec8ff.execute(Android25ProjectHandler.kt)
at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.Java:136)
at org.jetbrains.kotlin.gradle.plugin.Android25ProjectHandler.forEachVariant(Android25ProjectHandler.kt:27)
at org.jetbrains.kotlin.gradle.internal.AndroidSubplugin.applyExperimental(AndroidSubplugin.kt:170)
at org.jetbrains.kotlin.gradle.internal.AndroidSubplugin.apply(AndroidSubplugin.kt:102)
at org.jetbrains.kotlin.gradle.internal.AndroidSubplugin.apply(AndroidSubplugin.kt:76)
at org.jetbrains.kotlin.gradle.plugin.SubpluginEnvironment.addSubpluginOptions(KotlinPlugin.kt:772)
at org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler.processVariant(KotlinPlugin.kt:607)
at org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler.access$processVariant(KotlinPlugin.kt:455)
at org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler$handleProject$2$1.invoke(KotlinPlugin.kt:525)
at org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler$handleProject$2$1.invoke(KotlinPlugin.kt:455)
at org.jetbrains.kotlin.gradle.plugin.Android25ProjectHandlerKt$sam$Action$449ec8ff.execute(Android25ProjectHandler.kt)
at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.Java:136)
at org.jetbrains.kotlin.gradle.plugin.Android25ProjectHandler.forEachVariant(Android25ProjectHandler.kt:27)
at org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler$handleProject$2.execute(KotlinPlugin.kt:524)
at org.jetbrains.kotlin.gradle.plugin.AbstractAndroidProjectHandler$handleProject$2.execute(KotlinPlugin.kt:455)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.Java:91)
at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.Java:80)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.Java:42)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.Java:230)
at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.Java:149)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.Java:58)
... 92 more
Voici mon build.gradle (module d'application):
apply plugin: 'com.Android.application'
apply plugin: 'kotlin-Android'
apply plugin: 'kotlin-Android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.objectbox'
androidExtensions {
experimental = true
}
Android {
compileSdkVersion 27
defaultConfig {
applicationId "com.saga.yoyo"
minSdkVersion 21
targetSdkVersion 27
// Enabling multidex support.
multiDexEnabled true
versionCode 11
versionName "2.0"
testInstrumentationRunner "Android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
minifyEnabled false
shrinkResources false
useProguard false
proguardFiles getDefaultProguardFile('proguard-Android-optimize.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled true
shrinkResources true
useProguard true
proguardFiles getDefaultProguardFile('proguard-Android-optimize.txt'), 'proguard-rules.pro'
}
}
}
ext {
supportLibraryVersion = '28.0.2'
glideLibraryVersion = '4.6.1'
retrofitLibraryVersion = '2.4.0'
rxJavaVersion = '2.0.2'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "com.Android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.Android.support:cardview-v7:$supportLibraryVersion"
implementation "com.Android.support:support-v4:$supportLibraryVersion"
implementation "com.Android.support:support-v13:$supportLibraryVersion"
implementation "com.Android.support:design:$supportLibraryVersion"
implementation "com.Android.support:recyclerview-v7:$supportLibraryVersion"
//Glide library
implementation "com.github.bumptech.glide:glide:$glideLibraryVersion"
kapt "com.github.bumptech.glide:compiler:$glideLibraryVersion"
implementation 'com.Android.support.constraint:constraint-layout:1.1.3'
implementation "com.Android.support:support-v4:$supportLibraryVersion"
//Retrofit
implementation "com.squareup.retrofit2:retrofit:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitLibraryVersion"
//RxJava
implementation "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"
//ObjectBox
implementation "io.objectbox:objectbox-Android:$objectboxVersion"
implementation "io.objectbox:objectbox-kotlin:$objectboxVersion"
kapt "io.objectbox:objectbox-processor:$objectboxVersion"
//MaterialDialog
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
//ReactiveNetwork
implementation 'com.github.pwittchen:reactivenetwork-rx2:0.12.3'
//MultiDex
implementation 'com.Android.support:multidex:1.0.3'
//Fotoapparat
implementation 'io.fotoapparat.fotoapparat:library:2.2.0'
//ChartView
implementation 'com.github.razerdp:AnimatedPieView:1.2.4'
implementation "com.leinardi.Android:speed-dial:2.0.0"
implementation 'com.google.Android.gms:play-services-auth:16.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'me.shaohui.advancedluban:library:1.3.5'
implementation 'com.github.antonKozyriatskyi:CircularProgressIndicator:1.0.5'
testImplementation 'junit:junit:4.12'
// implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
androidTestImplementation 'com.Android.support.test:runner:1.0.2'
androidTestImplementation 'com.Android.support.test.espresso:espresso-core:3.0.2'
}
Voici mon build.gradle (module de projet):
buildscript {
ext.kotlin_version = '1.1.51'
ext.objectboxVersion = '1.4.3'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.Android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
votre version de Kotlin est assez ancienne.
ext.kotlin_version = '1.1.51'
Je pense que vous aurez besoin de le mettre à jour vers une version plus récente telle que:
ext.kotlin_version = '1.2.61'
Puis reconstruire.
J'ai pu résoudre ce problème en accédant à "Configurer les mises à jour du plug-in Kotlin" dans la barre de menus (Outils -> Kotlin -> Configurer les mises à jour du plug-in Kotlin), puis en installant la dernière version disponible.