0

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

Hadi tavakoli
  • 1,267
  • 2
  • 16
  • 30
  • You might want to add some details on how you are using the R.* mechanism, i.e. if you are packaging your own resources or using the standard android.R definitions. Also it helps to show exactly what errors are being thrown. – Michael Jun 30 '14 at 07:57

1 Answers1

3

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.

Michael
  • 3,776
  • 1
  • 16
  • 27