这是我尝试在android studio中构建我的androID应用程序时遇到的错误.该应用程序使用的是NDK,我认为是导致问题的原因.我是androID studio的新手,现在已经处理此问题大约2周了.经过大量的搜寻后,我不知道问题是什么/如何解决这个问题,也不清楚发生了什么.我也无法弄清楚如何在build.gradle文件上使用调试器,或者如何查看System.env.ANDROID_NDK_HOME的值.我似乎被困在墙上,所以任何帮助/建议都值得赞赏.
Error:Gradle: Execution Failed for task ':app:buildNative'.execCommand == null!
这是build.gradle中的buildNative任务.
task buildNative(type: Exec) { if (System.env.ANDROID_NDK_HOME != null) { def ndkBuild = new file(System.env.ANDROID_NDK_HOME, 'ndk-build') commandline ndkBuild } else { dolast { println '##################' println 'SkipPing NDK build' println 'Reason: ANDROID_NDK_HOME not set.' println '##################' } }}
这是堆栈跟踪
* Exception is:org.gradle.API.tasks.TaskExecutionException: Execution Failed for task ':app:buildNative'. at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.API.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.API.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) at org.gradle.API.internal.tasks.execution.ValIDatingTaskExecuter.execute(ValIDatingTaskExecuter.java:58) at org.gradle.API.internal.tasks.execution.SkipEmptySourcefilesTaskExecuter.execute(SkipEmptySourcefilesTaskExecuter.java:42) at org.gradle.API.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.API.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) at org.gradle.API.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.API.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processtask(AbstractTaskPlanExecutor.java:63) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.run(DefaultTaskPlanExecutor.java:33) at org.gradle.internal.FactorIEs.create(FactorIEs.java:22) at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198) at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:266) at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:135) at org.gradle.API.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:95) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:31) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) at org.gradle.execution.DefaultBuildExecuter.access0(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter.proceed(DefaultBuildExecuter.java:67) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54) at org.gradle.initialization.DefaultGradleLauncher.dobuildStages(DefaultGradleLauncher.java:166) at org.gradle.initialization.DefaultGradleLauncher.dobuild(DefaultGradleLauncher.java:113) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171) at org.gradle.launcher.cli.CommandlineActionFactory$ParseAndBuildAction.execute(CommandlineActionFactory.java:201) at org.gradle.launcher.cli.CommandlineActionFactory$ParseAndBuildAction.execute(CommandlineActionFactory.java:174) at org.gradle.launcher.cli.CommandlineActionFactory$WithLogging.execute(CommandlineActionFactory.java:170) at org.gradle.launcher.cli.CommandlineActionFactory$WithLogging.execute(CommandlineActionFactory.java:139) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:46) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.Main.main(Main.java:37) at org.gradle.launcher.bootstrap.Processbootstrap.runNoExit(Processbootstrap.java:50) at org.gradle.launcher.bootstrap.Processbootstrap.run(Processbootstrap.java:32) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) at org.gradle.wrapper.bootstrapMainStarter.start(bootstrapMainStarter.java:33) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)Caused by: java.lang.IllegalStateException: execCommand == null! at org.gradle.process.internal.AbstractExecHandleBuilder.build(AbstractExecHandleBuilder.java:120) at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:28) at org.gradle.API.tasks.Exec.exec(Exec.java:63) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219) at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212) at org.gradle.API.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201) at org.gradle.API.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533) at org.gradle.API.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516) at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) at org.gradle.API.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 52 more
解决方法:
错误:未定义System.env.ANDROID_NDK_HOME仅仅意味着您必须:
(假设您使用运行bash shell的终端运行linux):
export ANDROID_NDK_HOME=/opt/androID-ndk
(其中/ opt / androID-ndk是NDK目录的完整路径),然后在当前shell中启动AndroID Studio.如果从桌面启动AndroID Studio,则必须将上述行添加到.bashrc登录环境中.
但是,如果使用windows,则必须使用控制面板为NDK目录设置环境变量.
总结以上是内存溢出为你收集整理的“:应用程序:buildNative”. > execCommand == null!”,即可在Android Studio中使用NDK构建我的应用程序.是什么原因造成的/如何进一步处理?全部内容,希望文章能够帮你解决“:应用程序:buildNative”. > execCommand == null!”,即可在Android Studio中使用NDK构建我的应用程序.是什么原因造成的/如何进一步处理?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)