crazycodeboy / GitHubPopular

这是一个用来查看GitHub最受欢迎与最热项目的App,它基于React Native支持Android和iOS双平台。#适配RN最新版在这里☞#
http://coding.imooc.com/class/304.html
2.91k stars 582 forks source link

run-android java.lang.IllegalStateException: buildToolsVersion is not specified. #37

Open dalehqb opened 7 years ago

dalehqb commented 7 years ago

E:\react-native-p\GitHubPopular-master>react-native run-android JS server already running. Running D:\docs\android\android_Studio\android-sdk-windows-6.0\sdk/platform-tool s/adb reverse tcp:8081 tcp:8081 error: closed error: closed Could not run adb reverse: Command failed: D:\docs\android\android_Studio\androi d-sdk-windows-6.0\sdk/platform-tools/adb reverse tcp:8081 tcp:8081 Building and installing the app on the device (cd android && gradlew.bat install Debug... Failed to notify ProjectEvaluationListener.afterEvaluate(), but primary configur ation failure takes precedence. java.lang.IllegalStateException: buildToolsVersion is not specified. at com.google.common.base.Preconditions.checkState(Preconditions.java:17 3) at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.jav a:645) at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:608) at com.android.build.gradle.BasePlugin$10.call(BasePlugin.java:605) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java :156) at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java :120) at com.android.build.gradle.BasePlugin.lambda$createTasks$1(BasePlugin.j ava:603) at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.d ispatch(BroadcastDispatch.java:93) at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.d ispatch(BroadcastDispatch.java:82) at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(Abstract BroadcastDispatch.java:44) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatc h.java:79) at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatc h.java:30) at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocati onHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy16.afterEvaluate(Unknown Source) at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfte rEvaluate(LifecycleProjectEvaluator.java:82) at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigur e(LifecycleProjectEvaluator.java:76) at org.gradle.configuration.project.LifecycleProjectEvaluator.access$000 (LifecycleProjectEvaluator.java:33) at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute( LifecycleProjectEvaluator.java:53) at org.gradle.configuration.project.LifecycleProjectEvaluator$1.execute( LifecycleProjectEvaluator.java:50) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:61) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L ifecycleProjectEvaluator.java:50) at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProjec t.java:628) at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProjec t.java:129) at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProje ctEvaluator.java:35) at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(Task PathProjectEvaluator.java:62) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil dConfigurer.java:38) at org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGrad leLauncher.java:161) at org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGrad leLauncher.java:158) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul tBuildOperationExecutor.java:56) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:158) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle Launcher.java:119) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun cher.java:102) at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildControl ler.java:71) at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(Exe cuteBuildActionRunner.java:28) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildA ctionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:41) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:26) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.ex ecute(ContinuousBuildActionExecuter.java:75) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.ex ecute(ContinuousBuildActionExecuter.java:49) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter .execute(ServicesSetupBuildActionExecuter.java:44) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter .execute(ServicesSetupBuildActionExecuter.java:29) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBu ild.java:67) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.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:47) 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(Forw ardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw ardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(For wardClientInput.java:72) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogA ndCheckHealth.java:55) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClien t.java:60) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed( DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBu ild(EstablishBuildEnvironment.java:72) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:36) 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(Daemon StateCoordinator.java:297) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures. onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableE xecutorImpl.java:40) 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:748)

FAILURE: Build failed with an exception.

BUILD FAILED

dalehqb commented 7 years ago

https://github.com/crazycodeboy/GitHubPopular/issues/3 按照这个处理,可以编译了。

dalehqb commented 7 years ago

但是运行时,报红了; strict mode does not allow function declarations in a lexically nested statement.

hsay commented 7 years ago

get the same error

Mr-tail commented 6 years ago

+1