使用MSBuild构建Delphi Android项目的问题

时间:2015-09-08 08:15:56

标签: android delphi msbuild

我已经调用MSBuild来构建我的VCL项目很长一段时间了,并且想要添加一些android项目。我认为同样的调用对于针对Android而不是Windows的Delphi XE8项目起作用太过分了,但它确实似乎已经接近了。我的输出如下。正如你所看到的那样,它似乎在整个编译过程中得到了充分的效果,但却与清单一起做了一些事情。

有人可以建议我解决的问题吗?感谢。

09/08/2015 09:03:29     Building C:\Art_soft\Code\PRT-MS1\Delphi\Libraries\Multiplatform\Delphi projects\FMXCommonUnitTests_Android.dproj

Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.5485]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 08/09/2015 09:03:29.
Project "C:\Art_soft\Code\PRT-MS1\Delphi\Libraries\Multiplatform\Delphi projects\FMXCommonUnitTests_Android.dproj" on node 0 (Build target(s)).
  Creating directory "c:\scratch\msbuild".
BuildClassesDex:
  Merged dex A (520 defs/562.4KiB) with dex B (68 defs/120.5KiB). Result is 588 defs/833.3KiB. Took 0.3s
  Merged dex A (588 defs/833.3KiB) with dex B (3 defs/2.1KiB). Result is 591 defs/1078.6KiB. Took 0.1s
  Merged dex A (591 defs/1078.6KiB) with dex B (95 defs/99.0KiB). Result is 686 defs/1624.1KiB. Took 0.1s
  Result compacted from 2556.0KiB to 858.9KiB to save 1697.1KiB
  Merged dex A (686 defs/1624.1KiB) with dex B (87 defs/112.8KiB). Result is 773 defs/858.9KiB. Took 0.2s
  Merged dex A (773 defs/858.9KiB) with dex B (3 defs/5.2KiB). Result is 776 defs/1054.1KiB. Took 0.0s
  Merged dex A (776 defs/1054.1KiB) with dex B (25 defs/37.8KiB). Result is 801 defs/1410.8KiB. Took 0.1s
  Result compacted from 4165.5KiB to 2714.8KiB to save 1450.7KiB
  Merged dex A (801 defs/1410.8KiB) with dex B (1869 defs/1854.6KiB). Result is 2670 defs/2714.8KiB. Took 0.4s
BuildVersionResource:
  CodeGear Resource Compiler/Binder
  Version 1.2.2 Copyright (c) 2008-2012 Embarcadero Technologies Inc.

  Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0

  Copyright (C) Microsoft Corporation.  All rights reserved.


  Deleting file "FMXCommonUnitTests_Android.vrc".
c:\Program Files (x86)\Embarcadero\Studio\16.0\bin\CodeGear.Common.Targets(1315,5): error MSB4018: The "CreateAndroidManifestFile" task failed unexpectedly.
c:\Program Files (x86)\Embarcadero\Studio\16.0\bin\CodeGear.Common.Targets(1315,5): error MSB4018: System.UnauthorizedAccessException: Access to the path 'c:\scratch\msbuild\..\..\AndroidManifest.template.xml' is denied.
c:\Program Files (x86)\Embarcadero\Studio\16.0\bin\CodeGear.Common.Targets(1315,5): error MSB4018:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
c:\Program Files (x86)\Embarcadero\Studio\16.0\bin\CodeGear.Common.Targets(1315,5): error MSB4018:    at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite)
c:\Program Files (x86)\Embarcadero\Studio\16.0\bin\CodeGear.Common.Targets(1315,5): error MSB4018:    at Borland.Build.Tasks.Shared.CreateAndroidManifestFile.genManifestFile()
c:\Program Files (x86)\Embarcadero\Studio\16.0\bin\CodeGear.Common.Targets(1315,5): error MSB4018:    at Borland.Build.Tasks.Shared.CreateAndroidManifestFile.Execute()
c:\Program Files (x86)\Embarcadero\Studio\16.0\bin\CodeGear.Common.Targets(1315,5): error MSB4018:    at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
Done Building Project "C:\Art_soft\Code\PRT-MS1\Delphi\Libraries\Multiplatform\Delphi projects\FMXCommonUnitTests_Android.dproj" (Build target(s)) -- FAILED.

Build FAILED.

1 个答案:

答案 0 :(得分:0)

最好的方法是在具有相同名称的新文件夹中创建新的多设备项目。同名我指的是DPR和第一个主要的Delphi形式,UNIT1.PAS。创建后,尝试编译它。成功编译后,关闭Delphi并将原始项目中的文件复制到新创建的项目中。确保只有.DPR,.PAS,.FMX。 .VLB文件被复制过来。请勿替换任何DPROJ文件。

重新打开delphi和项目,你会看到你现在可以为Android编译。

此致