Как скомпилировать пакет MSI с помощью Compose for Desktop в IntelliJ-IDEA?

Я пытаюсь создать автономный пакет MSI для приложения Compose for Desktop, используя

./gradlew package

в терминале IntelliJ-IDEA, но я всегда получаю:

Задача:createRuntimeImage FAILED

Я только что создал пример проекта Compose for Desktop, предложенный IDE (используя мастер «Новый проект»), и безуспешно пытаюсь его скомпилировать. Я использую Windows 11 с установленным JDK 17 и MinGW. Версия Kotlin — 1.5.31, а версия Compose — 1.0.0. Я могу запустить приложение, щелкнув правой кнопкой мыши «Main.kt» и «Выполнить». Вывод терминала при попытке упаковать:

Не удалось выполнить задачу ':createRuntimeImage'. Сбой выполнения внешнего инструмента:

  • Команда: [C:\Program Files\Java\jdk-17.0.2\bin\jlink.exe, @C:\Users\MyUserName\IdeaProjects\untitled\build\compose\tmp\createRuntimeImage.args.txt]
  • Рабочий директор: []
  • Код выхода: 1
  • Стандартный журнал вывода: C:\Users\MyUserName\IdeaProjects\untitled\build\compose\logs\createRuntimeImage\jlink-2022-02-22-18-50-47-out.txt
  • Журнал ошибок: C:\Users\MyUserName\IdeaProjects\untitled\build\compose\logs\createRuntimeImage\jlink-2022-02-22-18-50-47-err.txt

Файл "[...]-err.txt" пуст, а файл "[...]-out.txt" содержит:

Ошибка: C:\Users\MyUserName\IdeaProjects

Наконец, файл «[...].args.txt» содержит:

"java.desktop" --add-modules "java.logging" --add-modules "jdk.crypto.ec" --strip-debug--no-header-files--no-man-pages--strip-native-commands--output "C:\Users\MyUserName\IdeaProjects\untitled\build\compose\tmp\main\runtime"

Я запускал его как:

      ./gradlew package --stacktrace

и вот результат:

org.gradle.api.tasks.TaskExecutionException: не удалось выполнить задачу «:createRuntimeImage». в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:188) в org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263) в org.gradle. api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:186) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174) в org.gradle.api.internal. tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109) в org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) в org.gradle.api.internal.tasks.execution. ResolveTaskExecutionModeExecuter.

Вызвано: java.lang.IllegalStateException: сбой при выполнении внешнего инструмента: в org.jetbrains.compose.desktop.application.internal.ExternalToolRunner.invoke(ExternalToolRunner.kt:71) в org.jetbrains.compose.desktop.application.internal. ExternalToolRunner.invoke$default(ExternalToolRunner.kt:22) в org.jetbrains.compose.desktop.application.tasks.AbstractJvmToolOperationTask.run(AbstractJvmToolOperationTask.kt:70) в java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0( Собственный метод) в java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) в java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) в org.gradle. internal.reflect.JavaMethod.invoke(JavaMethod.java:104) в org.gradle.api.internal.project.taskfactory.IncrementalInputsTaskAction.doExecute(IncrementalInputsTaskAction.java:32) в org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51) в org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction. java:25) в org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:506 ) в org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29) в org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26) в org.gradle.internal.operations. DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) в org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) в org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) в org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) в org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56) в org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:74) в org.gradle.internal.operations.UnmanagedBuildOperationWrapper .runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45) в org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:74) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:491) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:474) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:106) ) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271)
в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:249) в org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:83) в org.gradle .internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:37) в org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50) в org.gradle.internal.execution.steps .ExecuteStep$1.call(ExecuteStep.java:47) в org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) в org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) в org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) в org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) в org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) в org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) в org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62) в org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79) в org.gradle.internal .operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54) в org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79) в org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:47) в орг.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:37) в org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68) в org.gradle.internal.execution.steps. RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38) в org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:50) в org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36) в org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41) в org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74) в org.gradle.internal .execution.steps.TimeoutStep.execute(TimeoutStep.java:55) в org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51) в org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29) в org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:54) в org.gradle.internal .execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:35) в org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60) в org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60) (BroadcastChangingOutputsStep.java:27) в org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:174) в org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:74) в org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:45) в org.gradle.internal.выполнение.шаги.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:40) в org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:29) в org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36) в org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22) в org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:99) в org .gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:92) в org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52) в org.gradle.internal. выполнение.шаги.SkipUpToDateStep.execute(SkipUpToDateStep.java:36) в org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:85) в org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:42) в org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37) в org.gradle.internal.execution.steps. legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27) в org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:91) в org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49) в org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106) в org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:51) в org.gradle .internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:72) в org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:46) в org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86) в org.gradle.internal.execution.steps .SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86) в org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32) в org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38) в org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43) в org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31) в org. gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284) в org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40) в org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30) в org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37) в org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27) ) в org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44) в org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33) в org.gradle.internal. выполнение.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185) в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174) в org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStale.OutputsExecuter java:109) в org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) в org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51) в org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) в org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) в org.gradle .api.internal.tasks.execution.CatchExceptionTaskExecuter.выполнить (CatchExceptionTaskExecuter.java:36) в org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) в org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) в org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) в org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200) в org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195) в org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75) в org.gradle.internal.operations .DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68) в org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153) в org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68) в org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62) в org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79) в org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54) в org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79) в org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) в org.gradle.execution.plan .LocalTaskNodeExecutor.выполнить (LocalTaskNodeExecutor.java:74) в org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408) в org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:39) в org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388) в org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374) в org.gradle.execution.plan .DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127) в org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191) в org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182) в org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124) в org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) в org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) в org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)запустить (ThreadFactoryImpl.java: 56)запустить (ThreadFactoryImpl.java: 56)

Я пытался изменить версию Kotlin, Compose и JDK, но не смог решить эту проблему. Хотя я много гуглил об этом, другие решения, похоже, не работают для меня. Любая помощь будет оценена!

0 ответов

Другие вопросы по тегам