web-dev-qa-db-fra.com

la configuration du projet ': app' n'a pas réussi à trouver la révision de Build Tools

Ma génération de diplômes Android échoue avec un message d'erreur utile

$ gradle

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 24.4.1

J'ai regardé la version du SDK qu'Android Studio pense avoir installée.

 enter image description here

Il signale que 24.4.1 est installé, ce qui est conforme à mon fichier build.gradle

En outre, j'ai essayé d'installer le sdk avec ./Android list sdk -a; ./Android update sdk -a -u -t 1 mais l'échec persiste.

J'ai même essayé de mettre un fichier local.properties bidon

sdk.dir=/home/admin/DEADBEEF

qui donne

$ gradle

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory '/home/admin/DEADBEEF' does not exist.

En outre, le stacktrace ne semble pas beaucoup aider parce que je n'ai pas trouvé ce fichier source. Alors maintenant, j'ai commencé à fouiller dans le googlesource for DefaultSdkLoader

$ gradle --stacktrace

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 24.4.1

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.
        at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.Java:79)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.Java:74)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.Java:61)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.Java:510)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.Java:90)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.Java:47)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.Java:35)
        at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.Java:125)
        at org.gradle.internal.Factories$1.create(Factories.Java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:90)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:52)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.Java:122)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.Java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.Java:99)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.Java:93)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:90)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:62)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.Java:93)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.Java:82)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.Java:94)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.Java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.Java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.Java:43)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.Java:28)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.Java:78)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.Java:48)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.Java:52)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.Java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.Java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.Java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
        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:120)
        at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.Java:47)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.Java:66)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.Java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.Java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
        at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.Java:41)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.Java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.Java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.Java:246)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.Java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.Java:40)
Caused by: Java.lang.IllegalStateException: failed to find Build Tools revision 24.4.1
        at com.Android.builder.sdk.DefaultSdkLoader.getTargetInfo(DefaultSdkLoader.Java:93)
        at com.Android.build.gradle.internal.SdkHandler.initTarget(SdkHandler.Java:89)
        at com.Android.build.gradle.BasePlugin.ensureTargetSetup(BasePlugin.Java:673)
        at com.Android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.Java:610)
        at com.Android.build.gradle.BasePlugin$10$1.call(BasePlugin.Java:566)
        at com.Android.build.gradle.BasePlugin$10$1.call(BasePlugin.Java:563)
        at com.Android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.Java:55)
        at com.Android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.Java:47)
        at com.Android.build.gradle.BasePlugin$10.execute(BasePlugin.Java:562)
        at com.Android.build.gradle.BasePlugin$10.execute(BasePlugin.Java:559)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.Java:93)
        at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.Java:82)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.Java:44)
        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)
        ... 52 more

Avant que DefaultSdkLoader puisse utiliser un outil de construction pour compiler le projet, le 

com.Android.sdklib.repository.local.LocalSdk#scanBuildTools

est appelé en utilisant votre répertoire SDK. Une nouvelle BuildToolInfo est créée, qui utilise le type PKG_BUILD_TOOLS pour rechercher les outils de construction. Alors, je viens de regarder dans mon dossier build-tools dans mon SDK Android et, voilà! Il n'y a pas d'outils de construction pour 24.4.1

7
activedecay

Cela se produit parce que Build Tools révision 24.4.1 n'existe pas.

La dernière version est 23.0.2.
Ces outils sont inclus dans le package SDK et installés dans le répertoire <sdk>/build-tools/.

Ne confondez pas le Outils du SDK Android avec Outils de compilation du SDK .

Changer dans votre build.gradle

Android {
   buildToolsVersion "23.0.2"
   // ...

}
11
Gabriele Mariotti

J'ai découvert que cela se produisait également si vous désinstalliez certains packages de votre projet rea-native et qu'il y avait toujours des packages dans vos dépendances de gradateur de construction au bas de la page, comme:

{
 project(':react-native-sound-player')
}
2
Berke

Pour moi, dataBinding {enabled true} a été activé dans Gradle, ce qui m'a aidé à

1
J.Doe

essayez également d'augmenter la version de gradle dans le build.gradle de votre projet. Je m'a aidé

1
kazimad