• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

AIR SDK 17 and ANE problems when packaging app for Android

Community Beginner ,
Jun 10, 2015 Jun 10, 2015

Copy link to clipboard

Copied

Hi,

I've been facing an issue when trying packaging my application using AIR SDK 17. The error details is below, I have also tried using AIR SDK 15, and AIR SDK 16, but I still get the same error.

Error occurred while packaging the application:

dx tool failed:

UNEXPECTED TOP-LEVEL EXCEPTION:

java.lang.IllegalArgumentException: already added: Landroid/support/v7/appcompat/R$anim;

  at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)

  at com.android.dx.dex.file.DexFile.add(DexFile.java:143)

  at com.android.dx.command.dexer.Main.processClass(Main.java:301)

  at com.android.dx.command.dexer.Main.processFileBytes(Main.java:278)

  at com.android.dx.command.dexer.Main.access$100(Main.java:56)

  at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:229)

  at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)

  at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)

  at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)

  at com.android.dx.command.dexer.Main.processOne(Main.java:247)

  at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)

  at com.android.dx.command.dexer.Main.run(Main.java:139)

  at com.android.dx.command.dexer.Main.main(Main.java:120)

  at com.android.dx.command.Main.main(Main.java:89)

1 error; aborting

However, when I change to use < AIR SDK 14, the packaging works just fine. I have also google around this issue, and the reason is duplicate library android-support-v7-appcompat.jar in the ANE. It doesn't make sense to me when I only have 1 ANE in use in my project.

So I tried removing the library android-support-v7-appcompat.jar in the ANE file and repackaging the ANE, now it shows a different error as below screenshot. It looks like android.support.v7.mediarouter relying on android.support.v7.appcompat, so removing android-support-v7-appcompat.jar is not solving the problem.

error-after-removing-appcompat.png

This is my android-platform.xml

<?xml version="1.0"?>

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

  <packagedDependencies>

  <packagedDependency>android-support-v4.jar</packagedDependency>

  <packagedDependency>google-play-services.jar</packagedDependency>

  <packagedDependency>android-support-v7-appcompat.jar</packagedDependency>

  <packagedDependency>android-support-v7-mediarouter.jar</packagedDependency>

  <packagedDependency>clink210.jar</packagedDependency>

  </packagedDependencies>

  <packagedResources>

  <packagedResource>

  <packageName>com.google.android.gms</packageName>

  <folderName>google-play-services-res</folderName>

  </packagedResource>

  <packagedResource>

  <packageName>android.support.v7.appcompat</packageName>

  <folderName>android-support-v7-appcompat-res</folderName>

  </packagedResource>

  <packagedResource>

  <packageName>android.support.v7.mediarouter</packageName>

  <folderName>android-support-v7-mediarouter-res</folderName>

  </packagedResource>

  </packagedResources>

</platform>

If anyone is facing the same problem, I really appreciate if you would help me figuring out how to resolve this issue.

Regards,

Dan

TOPICS
Performance issues

Views

2.2K

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
community guidelines
Adobe Employee ,
Jun 12, 2015 Jun 12, 2015

Copy link to clipboard

Copied

Hi,

Please let us know which ANE are you using in your application so that we can reproduce this issue at our end.

Regards,

Krati

Votes

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
community guidelines
Community Beginner ,
Jun 12, 2015 Jun 12, 2015

Copy link to clipboard

Copied

Hi Krati,

Thank you for getting back to me. Please find the link below for the ANE, I also include the source to build ANE:

https://www.dropbox.com/s/zn7mkohqfd2dd6d/ANE-resources.zip?dl=0‌

The issue I had described in my previous post happens since AIR SDK 15, I have read its release notes, I guess there would be something to do with the AIR bug fix, please correct me if I'm wrong :

"Android - Auto resolve conflicting common library JARs and common resources for multiple ANEs. ADT will throw warning in case of auto-resolve. (3780590)"

I'm really looking forward to your responses as I have spending 3 days with no luck on fixing it.

Thank you

Votes

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
community guidelines
Adobe Employee ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

Thanks for reporting the issue.

We are able to reproduce the issue and further investigating it now.

Regards,

Krati

Votes

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
community guidelines
Community Beginner ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

Thanks Krati,

I think I know what went wrong with the appcompat library included in my ANE. I digged a bit more in AIR SDK 15 runtime library ( AIR-SDK-17\lib\android\lib\runtimeClasses.jar ), start from AIR 15 Adobe includes android/support/v7/appcompat in AIR runtime classes library (screenshot below). That's why when I use appcompat as a dependency in ANE, it causes conflicts when packaging the app. My work-around so far is removing appcompat dependency in the ANE's android-platform.xml, and delete all appcompat's .jar and resources in ANE.


In addition, as you can see on my second error screenshot in my initial post, since the library mediarouter depends on appcompat library and mediarouter couldn't find any appcompat resources included in AIR 15, I have to manually copy resources from deleted appcompat resources which mediarouter needs to mediarouter resources. Finally, it fixes the conflicts problems and the ANE functionality works as expected.

air-android-support.png

This is my final android-platform.xml

<?xml version="1.0"?>

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

  <packagedDependencies>

  <packagedDependency>android-support-v4.jar</packagedDependency>

  <packagedDependency>google-play-services.jar</packagedDependency>

  <packagedDependency>android-support-v7-mediarouter.jar</packagedDependency>

  <packagedDependency>clink210.jar</packagedDependency>

  </packagedDependencies>

  <packagedResources>

  <packagedResource>

  <packageName>com.google.android.gms</packageName>

  <folderName>google-play-services-res</folderName>

  </packagedResource>

  <packagedResource>

  <packageName>android.support.v7.mediarouter</packageName>

  <folderName>android-support-v7-mediarouter-res</folderName>

  </packagedResource>

  </packagedResources>

</platform>

Hope it helps

Votes

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
community guidelines
Community Beginner ,
Jan 03, 2016 Jan 03, 2016

Copy link to clipboard

Copied

Hi danti83500242: I'm having similar problems trying to include android-support-v7-mediarouter in an ANE, so wondered if you might be able to share your updated mediarouter resource folder?

Votes

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
community guidelines
Engaged ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

Hi,

It would be good if the app compat v7 library was separated from the AIR runtime library. Or at least completely included and documented which version is included as it stands it seems only the resources are included.

We are trying to support features in our ANEs that this inclusion makes impossible and even more so as the Android library develops this appcompat library is becoming very important.

Could you at least tell us which version of the library is currently being used? Does it match the build tools 23.0.1?

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

Votes

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
community guidelines
Community Beginner ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

There seems to be very little activity here, so you might have more luck posting this as an issue or feature request on Adobe Bugbase: https://bugbase.adobe.com/

Votes

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
community guidelines
Engaged ,
Sep 12, 2016 Sep 12, 2016

Copy link to clipboard

Copied

LATEST

Yeah it's not necessarily a bug though, just something that is limiting the scope of AIR at the moment.

We are happy to work around it as best we can however we need guidance from the AIR team as to how they wish to manage it. Keeping old libraries embedded in the AIR runtime is going to cause issues, however if they plan to update them consistently then we can work with that.

Does anyone know if or where the versions packaged with AIR are documented? Both the build tools and the appcompat v7 lib are the main ones we are concerned about here.

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

Votes

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
community guidelines
Engaged ,
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

I have the same problem with including some third party libraries into ANE.

Votes

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
community guidelines
Jun 16, 2015 Jun 16, 2015

Copy link to clipboard

Copied

Alex and Duc,

To know more about this problem and its solution please read blog post Multiple ANEs and conflicting resources

The entry of same JAR in Runtime.apk and in ANE can cause the same problem.

-Nimisha

Votes

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
community guidelines