Hadi tavakoli
Hadi tavakoli

Reputation: 1317

R.* mechanism in building air native extensions

I am trying to use the new approach for accessing android resources using the R.* mechanism introduced in Air SDK 4.0 and above. but I have a really hard time understanding how to setup the platform.xml because although I can build the .ane , when I run my app, it throws many different weird appt tool error messages!

like: values\strings.xml: Original is here. and other similar errors

or even on a project with no resources it said something like: android-res.jar is not a directory

I couldn't find any documentation rather than: http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2e74ffb4130044f3619-7ff8.html

Can someone please tell me what am I doing wrong? here's my setup and my adt call command: enter image description here

Upvotes: 0

Views: 749

Answers (1)

Michael
Michael

Reputation: 3871

You should remove all common name resource files, such as strings.xml. These will conflict with other extensions and even the built in AIR resources.

Make sure you name your resources something unique: extensionname_strings.xml

You also need to add in the packagedResources node to your Android platform options, for example, this is from our Dialog extension (replace the package name with the core package name of your extension):

<platform xmlns="http://ns.adobe.com/air/extension/4.0">
    <packagedDependencies>
        <packagedDependency>some_lib.jar</packagedDependency>
    </packagedDependencies>
    <packagedResources>
        <packagedResource>
            <packageName>com.distriqt.extension.dialog</packageName>
            <folderName>res</folderName>
        </packagedResource>
    </packagedResources>
</platform>

Then you need to make sure that you copy the res directory to your build directory, i.e. the same directory as the some_lib.jar and the jar for your extension library.

Upvotes: 3

Related Questions