我有一个Ionic/Cordova项目,我想通过模拟器模拟这个项目,所以我使用“Ionic platform add android”命令添加了android平台,然后我试图运行“Ionic build android”命令,但失败了,输出是:
ionic build android
Running command: "C:\Program Files\nodejs\node.exe" "D:\web development\My-Stuff s\ionic\Learn ionic by building apps\mynote\hooks\after_prepare\010_add_platform _class.js" "D:/web development/My-Stuffs/ionic/Learn ionic by building apps/myno te"
add to body class: platform-android
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_80
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 6)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.jav a:599)
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.ja va:55)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.ja va: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.listener.BroadcastDispatch$ActionInvocationHandler.dispatc h(BroadcastDispatch.java:109)
at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatc h(BroadcastDispatch.java:98)
at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java :83)
at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java :31)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocat ionHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy13.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfte rEvaluate(LifecycleProjectEvaluator.java:79)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(L ifecycleProjectEvaluator.java:65)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:504)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj ect.java:83)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(Task PathProjectEvaluator.java:42)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil dConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default GradleLauncher.java:129)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle Launcher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun cher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon troller.run(InProcessBuildActionExecuter.java:80)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav a:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce ssBuildActionExecuter.java:26)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBu ild.java:47)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed (DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute( WatchForDisconnection.java:35)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed (DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute (ResetDeprecationLogger.java:24)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed (DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execut e(StartStopIfBuildAndStop.java:33)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed (DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw ardClientInput.java:71)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(Forw ardClientInput.java:69)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(For wardClientInput.java:69)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed (DaemonCommandExecution.java:119)
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:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed (DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBu ild(EstablishBuildEnvironment.java:70)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(Build CommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed (DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(Da emonHygieneAction.java:39)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed (DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1. run(StartBuildOrRespondWithBusy.java:46)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(Daemon StateCoordinator.java:246)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecut orImpl$1.run(DefaultExecutorFactory.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:615)
at java.lang.Thread.run(Thread.java:745)
FAILURE: Build failed with an exception.
* Where:
Script 'D:\web development\My-Stuffs\ionic\Learn ionic by building apps\mynote\p latforms\android\CordovaLib\cordova.gradle' line: 64
* What went wrong:
A problem occurred evaluating root project 'android'.
> No installed build tools found. Please install the Android build tools version 19.1.0 or higher.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 16.86 secs
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s ,/c,""D:\web development\My-Stuffs\ionic\Learn ionic by building apps\mynote\pla tforms\android\gradlew" cdvBuildDebug -b "D:\web development\My-Stuffs\ionic\Lea rn ionic by building apps\mynote\platforms\android\build.gradle" -Dorg.gradle.da emon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,""D:\web development\My-St uffs\ionic\Learn ionic by building apps\mynote\platforms\android\gradlew" cdvBui ldDebug -b "D:\web development\My-Stuffs\ionic\Learn ionic by building apps\myno te\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.useDepreca tedNdk=true"
我的系统信息:
Cordova CLI: 6.0.0
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Windows 7 SP1
Node Version: v4.4.0
我正面临这个问题。问题是我的ANDROID_HOME路径指向Android Studio的文件夹。我把它改成指向我的Android SDK文件夹,问题就解决了。
检查您的Android_Home:echo$Android_Home
它应该指向Android SDK文件夹:export android_home=“your-android-sdk-folder”
我似乎不明白为什么JitPack无法构建我的库,当我检查构建日志时,我发现了以下错误和警告: 我试图通过遵循这个StackOverflow答案中的建议来解决Java版本错误,但它没有起到任何作用。 我做错了什么?我如何修复它?
我试图建立在Jenkins的基础上。我有例外。 C:\Users\anuj.jenkins\plugins\maven-plugin\WEB-INF\lib\maven32-agent-1.12-alpha-1.jar;D:\unicmoer\software\apache-maven-3.2.3\boot\plexus-classworlds-2.5.1.jar;D:\unicmoer\soft
我不知道该怎么办;我卡住了。我有以下依赖关系,以前一切都很好: 然后,突然,它开始说: 我不确定是什么改变了,或者是什么导致了这种情况的发生。
> 错误:执行任务“:Shared_Preferences:VerifyReleaseResources”失败。 工作者引发了1个异常:com.Android.builder.internal.aapt.v2.aapt2异常:Android资源链接失败 d:\my-flutter-app\build\shared_preference\intermediates\res\merged\releas