Autodesk Forge:WorkItem因AppPackage问题而失败

时间:2019-02-15 19:43:56

标签: autodesk-forge autodesk-designautomation

我的AppPackage无法加载,并且无法在文档中或错误消息/代码中找到确切答案。

我通过将捆绑包解压缩到本地计算机上的“ C:\ Program Files \ Autodesk \ ApplicationPlugins”中进行了测试,该捆绑包可以按预期运行/加载。

AppPackage指示它已成功创建,我确定它是最新版本。

该插件是一个.NET DLL文件。

错误报告消息

[02/15/2019 18:44:48] Starting work item ffbcfc1ca50546fc9a6372424b2cdae1
[02/15/2019 18:44:48] Start download phase.
[02/15/2019 18:44:48] Start downloading file <CENSORED>.
[02/15/2019 18:44:48] Start preparing AppPackage <CENSORED>.
[02/15/2019 18:44:48] Download bits and install app to local cache.
[02/15/2019 18:44:48] End downloading file <CENSORED>.
[02/15/2019 18:44:48] End download phase.
[02/15/2019 18:44:48] Error: Failed to prepare app package(s).
[02/15/2019 18:44:48] Error: An unexpected error happened during phase Downloading of job.
[02/15/2019 18:44:48] Job finished with result FailedEnvironmentSetup

PackageContents.XML

<?xml version="1.0" encoding="utf-8" ?>
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="AutoCAD"
                    AppVersion="0.1.0"
                    ProductType="Application"
                    Name="CENSORED"
                    Description="CENSORED"
                    Author="CENSORED"
                    FriendlyVersion="0.1.0"
                    ProductCode="{CENSORED}"
                    UpgradeCode="{CENSORED}"
                    Helpfile="./help.html"
                    Icon="./my-icon.jpeg">

    <CompanyDetails Name="CENSORED" Phone="CENSORED" Email="CENSORED"/>

    <Components>
        <RuntimeRequirements SeriesMin="R22.0" Platform="AutoCAD*" OS="Win64"/>

        <ComponentEntry AppName="CENSORED" Version="0.1.0" ModuleName="./CENSORED.dll" AppType=".Net"
                        AppDescription="CENSORED" LoadOnAutoCADStartup="True">
        </ComponentEntry>
    </Components>

</ApplicationPackage>

活动定义: 注意我必须在这里手动扩展一些内联函数,因为我将其分为多个部分。如果我有错字,请放心,代码实际上可以在语法上运行。

let activity = <CreateActivityRequest>{
            Id: id,
            Version: 1,
            IsPublic: false,
            AppPackages: ['PACKAGE_NAME'],
            Instruction: {Script: 'D6 '},
            RequiredEngineVersion: '22.0',
            Parameters: {
                InputParameters: [{Name: 'HostDwg', LocalFileName: '$(HostDwg)'}],
                OutputParameters: [{Name: 'output', LocalFileName: `output.json`}]
            },
            HostApplication: undefined,
            AllowedChildProcesses: []
        };

AppPackages列表中的条目:

{
  References: [],
  Resource: '...',
  RequiredEngineVersion: '22.0',
  IsPublic: false,
  IsObjectEnabler: false,
  Version: 1,
  Timestamp: '2019-02-15T19:32:33.527Z',
  Description: '',
  Id: 'CENSORED'
},

1 个答案:

答案 0 :(得分:1)

请务必仔细检查您如何压缩上传的AppPackage。如果您查看的是zip文件,请确保有一个名为PACKAGE_NAME.bundle的文件夹,而PackageContents.XML文件位于该PACKAGE_NAME.bundle文件夹中。