Highlighted

ANE with Android packagedDependency

New Here ,
Mar 11, 2014

Copy link to clipboard

Copied

I've been working on an Ubertesters ANE for Android/iOS, starting with Android, and I've managed to get it to package the Ubertesters sdk as a depedency however when I build my game I get this as a result.

aapt tool failed:C:\Users\****\AppData\Local\Temp\4cefa32a-ef1e-4f66-ba1c-06c2b6a3289c\res\values\colors.xml: error: Duplicate file. C:\Users\****\AppData\Local\Temp\3c65dec5-4ebe-4b94-b90c-c3164cdefb12\captive_runtime_res\values\colors.xml: Original is here.

Suggestions/Thoughts?

TOPICS
Development

Views

4.3K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

ANE with Android packagedDependency

New Here ,
Mar 11, 2014

Copy link to clipboard

Copied

I've been working on an Ubertesters ANE for Android/iOS, starting with Android, and I've managed to get it to package the Ubertesters sdk as a depedency however when I build my game I get this as a result.

aapt tool failed:C:\Users\****\AppData\Local\Temp\4cefa32a-ef1e-4f66-ba1c-06c2b6a3289c\res\values\colors.xml: error: Duplicate file. C:\Users\****\AppData\Local\Temp\3c65dec5-4ebe-4b94-b90c-c3164cdefb12\captive_runtime_res\values\colors.xml: Original is here.

Suggestions/Thoughts?

TOPICS
Development

Views

4.3K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 11, 2014 2
Engaged ,
May 27, 2014

Copy link to clipboard

Copied

What are you using to package ?

We've had some really odd results on Windows with Android ANE's that have a packaged resources and haven't been able to resolve it yet. While the same extensions package under OSX. Errors include things like:

aapt tool failed:C:\Users\{Name}\AppData\Local\Temp\599734f5-ec3d-438e-ac4c-b0d4ec98a0c3\app_entry_res\values\strings.xml:

19: error: Resource at app_version appears in overlay but not in the base package; use <add-resource> to add.

air native extensions // https://airnativeextensions.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 27, 2014 0
Community Beginner ,
Jul 27, 2014

Copy link to clipboard

Copied

I'm having a similar (if not the same) problem. My problem occurs when I try to include a packagedDependency in the ANE I am building. I get many lines of error messages complaining about "overlays" and "base packages." Everything works fine as long as I don't try to package a dependency in the ANE.

I'm building the ANE on a PC running Windows 7 64-bit. I'm using ADT version 13.0.0.111.

platform.xml

<platform xmlns="http://ns.adobe.com/air/extension/4.0">

    <packagedDependencies>

        <packagedDependency>gson-2.2.4.jar</packagedDependency>

    </packagedDependencies>

</platform>

Command used to create ANE file:

adt -package -target ane packaged-extensions\Extension.ane extension.xml -swc Extension.swc -platform Android-ARM -platformoptions platform.xml gson-2.2.4.jar -C platform\Android . -platform default -C platform\default library.swf

Command used to create SWF file:

amxmlc -compiler.source-path=. .\<path>\explorer\ExplorerApp.mxml -compiler.include-libraries=packaged-extensions\Extension.ane -output .\ExplorerApp.swf

Command used to create APK file:

adt -package -target apk-captive-runtime -storetype pkcs12 -keystore certificate.pfx ExplorerApp.apk explorer-app.xml ExplorerApp.swf -extdir packaged-extensions

Example of error message:

C:\<user>\AppData\Local\Temp\23c05014-fb83-4f5f-8df1-a30a6b5a1670\app_entry_res\values-zh-rTW\strings.xml:19: error: Resource at app_version appears in overlay but not in the base package; use <add-resource> to add.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2014 0
Engaged ,
Jul 27, 2014

Copy link to clipboard

Copied

I figured out what was causing our error so I thought I'd let you know, see if it helps you.

We had left the default strings.xml and other resources in the android library that we were writing our extension in. They just define some defaults (like app_version) and use it in the mail.xml layout.

As we don't actually use any of that in our extension we simply removed it, and the errors disappeared.

Any resources that we do use in our library (layouts/strings/images) we just make sure that they are uniquely names in our extension and don't overlap any of our other extensions or default file names (such as strings.xml).

Hope that helps

air native extensions // https://airnativeextensions.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2014 0
Adobe Community Professional ,
Jul 27, 2014

Copy link to clipboard

Copied

Thanks for reporting back.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 27, 2014 0
Community Beginner ,
Jul 31, 2014

Copy link to clipboard

Copied

Thank you very much for writing back. Sorry for not writing back to thank you sooner.

I didn't quite understand your proposed solution (probably because I'm very new to both AIR and android development). What do you mean by "the android library" you were writing your extension in? Do you mean the android.jar file that comes with the android SDK? Or were you referring to something specific to the AIR framework?

Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 31, 2014 0
Engaged ,
Jul 31, 2014

Copy link to clipboard

Copied

Hi,

I meant the java code that you are writing as part of your native extension. Generally you create an "android library project" to contain the native code, but it includes several default resources that were causing our problem.

Cheers

air native extensions // https://airnativeextensions.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 31, 2014 0
Community Beginner ,
Oct 08, 2014

Copy link to clipboard

Copied

Thank you again for you explanation.

For the benefit of others, I eventually got around this issue by building on a Mac (OS X 10.9.5) - as michaelarchboldalready mentioned above. The Java side of my native extension did not include any resources at all (only class files) and if there was a conflict, it would have been very unexpected and non-obvious to anyone. Even if there were a conflict, why would this conflict only be an issue on Windows and not OSX? Seems like a bug to me.

In conclusion, based on my recent experience, ANEs for Android with dependencies must be created on a Mac (or at least cannot be successfully created on a PC running Windows 7 64-bit).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 08, 2014 0
Engaged ,
Oct 08, 2014

Copy link to clipboard

Copied

Hi,

I'd guess it's something to do with Java variations on the two platforms, but not sure. It does look like your error is related to a packaged resource in an ANE though? Whoever created the ANE you are using should rename the colors.xml file to something more unique. We've taken to prefixing ours with the extension id, eg: com_distriqt_dialog_colors.xml.

I can verify that doing this removes the error in all of our cases.

Cheers  

air native extensions // https://airnativeextensions.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 08, 2014 0
Community Beginner ,
Oct 09, 2014

Copy link to clipboard

Copied

The error message involving colors.xml actually wasn't mine, it belonged to the person who originally posted the question.

It's been several months, so I don't quite remember, but I got lines and lines of error messages. Some of those lines involved a file named strings.xml, but not all of them. All I was trying to do was include the gson library as a dependencies in the ANE I was using with an app (both ANE and app were created by myself). The gson JAR file only contained class files. My extension did not contain a file named strings.xml. It was simply class files, the action script library, and the gson library, packaged like normal.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 09, 2014 0
Explorer ,
Mar 12, 2015

Copy link to clipboard

Copied

I had the same problem. Helped this:

In ANE introduced empty file res/values/strings.xm (necessarily in the catalog res/values/)

<?xml version="1.0" encoding="utf-8"?>

<resources>

</resources>

In platformoptions file for android:

<platform xmlns="http://ns.adobe.com/air/extension/16.0">

    <packagedDependencies>

        <packagedDependency>...</packagedDependency>

    </packagedDependencies>

   

    <packagedResources>

        <packagedResource>

            <packageName>ru.flashpress.uid.FPUniqueIdExt</packageName>

            <folderName>res</folderName>

        </packagedResource>

    </packagedResources>

</platform>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 12, 2015 1