在 Android 上许可 Adobe AIR 应用程序
我根据本文创建了一个测试应用程序: http://www.adobe.com/devnet/air/articles/android-licensing-native-extensions.html
一切顺利,直到这些行 - 编译错误。
在应用程序标记后添加扩展 ID 标记:
<extensions>
<extensionID>com.adobe.air.sampleextensions.android.licensing</extensionID>
</extensions>
我将该行直接放入应用程序描述 XML 中。如果我在使用 ADT 构建时不插入这些行,则会出现错误:
无效的扩展描述符:extension.xml
我的extension.xml:
<extension xmlns="http://ns.adobe.com/air/extension/3.1">
<id>com.adobe.air.sampleextensions.android.licensing</id>
<versionNumber>1.1.0</versionNumber>
<platforms>
<platform name="Android-ARM">
<applicationDeployment>
<nativeLibrary>SampleAndroidLicensing.jar</nativeLibrary>
<initializer>com.adobe.air.sampleextensions.android.licensing</initializer>
<finalizer>com.adobe.air.sampleextensions.android.licensing</finalizer>
</applicationDeployment>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
</platforms>
</extension>
我使用ADT命令打包ANE文件:
adt -package -storetype pkcs12 -keystore C:\PackageAL\temp.p12 -keypass mypassword -target ane com.adobe.air.sampleextensions.android.licensing.ane extension.xml -swc AndroidLicensingLib.swc -platform Android-ARM -C .\Android-ARM\ .
I create a test application on the basis of this article: http://www.adobe.com/devnet/air/articles/android-licensing-native-extensions.html
All goes well until these lines - compilation error.
Add an Extension ID tag following the application tag:
<extensions>
<extensionID>com.adobe.air.sampleextensions.android.licensing</extensionID>
</extensions>
I put the line directly to app description XML. If I do not insert these lines when I build with ADT I get error:
Invalid extension descriptor: extension.xml
My extension.xml:
<extension xmlns="http://ns.adobe.com/air/extension/3.1">
<id>com.adobe.air.sampleextensions.android.licensing</id>
<versionNumber>1.1.0</versionNumber>
<platforms>
<platform name="Android-ARM">
<applicationDeployment>
<nativeLibrary>SampleAndroidLicensing.jar</nativeLibrary>
<initializer>com.adobe.air.sampleextensions.android.licensing</initializer>
<finalizer>com.adobe.air.sampleextensions.android.licensing</finalizer>
</applicationDeployment>
</platform>
<platform name="default">
<applicationDeployment/>
</platform>
</platforms>
</extension>
I use ADT command to package the ANE file:
adt -package -storetype pkcs12 -keystore C:\PackageAL\temp.p12 -keypass mypassword -target ane com.adobe.air.sampleextensions.android.licensing.ane extension.xml -swc AndroidLicensingLib.swc -platform Android-ARM -C .\Android-ARM\ .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当 ADT 给出以下错误:“无效的扩展描述符:extension.xml”时,并不意味着本机扩展描述符文件在语法上不正确。不幸的是,这是一个误导性的错误消息。所发生的情况是描述符 XML 文件的路径无效(找不到该文件)。它应该显示如下内容:“找不到描述符文件:extension.xml”。
确保在调用 ADT 工具时提供描述符文件的完整(绝对)路径。
附加说明:当 ADT 无法解析描述符文件时,它会向您提供更具描述性的错误消息,指出发生错误的确切行。然而,这不是你的情况。
When ADT gives the following error: 'Invalid extension descriptor: extension.xml', it does not mean that the native extension descriptor file is syntactically incorrect. Unfortunately, this is a misleading error message. What happens is that the path to the descriptor XML file is invalid (the file cannot be found). It should say something like: "Cannot find descriptor file: extension.xml".
Make sure that when you invoke the ADT tool, you provide the full (absolute) path to your descriptor file.
Additional note: when ADT fails to parse the descriptor file it will provide you with a more descriptive error message pointing the exact line where the error occurs. However, this is not your case.