Skip to main content
Known Participant
May 20, 2014
Question

Android ANE PackagedResources Bug

  • May 20, 2014
  • 1 reply
  • 1425 views

We have one ANE for handling all Facebook communications, to build this I use <packagedDependencies> in my platform options on Android to reference facebooksdk.jar, and <packagedResources> to package in the res folder of facebook (renaming it to facebook_res).  If used on it's own, this works perfectly.

However, if you seemingly use any other ANE that also uses <packagedDependencies>, or <packagedResources>, the whole thing falls over in a very confusing manner.

This is a fairly complex issue, so I've created the necessary amount of projects as examples, and thrown them up to SixMinute/ANEResourcesBugExample · GitHub, https://github.com/SixMinute/ANEResourcesBugExample/archive/master.zip.

When a second ANE is included, basically the R.java file, and it's siblings don't seem to be created, or compiled into com.facebook.android, which is where they're supposed to go.  In the example I've provided, I ran the eventual apk (ANE3Test) through the decompiler at Android APK Decompiler, and after getting the error "java.lang.NoClassDefFoundError: com.facebook.android.R$layout", the decompiled package (which is also up on GitHub in ANE3Source) shows that indeed, src/com/facebook/android contains no R.java files.  Weirdly, they do appear in src/air/com/sixminute/ANE3Test/debug, the default package for the entry point, and also if I add a dummy <packagedResources> element into the ANE2 project, the R.java files would end up in src/com/chartboost/android as well, but still not where they should be in src/com/facebook/android.

This basically prevents us (and probably anyone else) from using the new resource Android packaging system at all <packagedResources>, or only able to use the new system with one ANE only, and have to unzip the jars as was done previously for all the rest.

Bugbase link - Bug#3763065 - Android ANE PackagedResources Bug

This topic has been closed for replies.

1 reply

Pahup
Adobe Employee
Adobe Employee
May 20, 2014

Hi,

Thanks for reporting the issue and explaining it with sample sources. We already have a similar issue under investigations with us and is reported at https://bugbase.adobe.com/index.cfm?event=bug&id=3752414

-Thanks once again

Pahup

seaders6mAuthor
Known Participant
May 20, 2014

Hi Pahup,


I see that it's very similar (and almost certainly the same bug source), but one thing that I don't think either side pointed out in that bug conversation is the R.java in the default folder, src/air/com/sixminute/ANE3Test/debug for us.  Also in that bug, MilkMan are talking about multiple projects using multiple <packagedResources>, in the example that I'm providing, only one ANE is using <packagedResources>.  Both are using <packagedDependencies>, but when the second ANE is included, those resources disappear.


Also, I've just added a second branch multiple_resource_anes, SixMinute/ANEResourcesBugExample at multiple_resource_anes · GitHub (again including source) which shows the weirder behaviour, when you've multiple ANEs which use packagedResources.  In this specific case, src/com/chartboost/android - ANEResourcesBugExample/ANE3Source/src/com/chartboost/android at multiple_resource_anes · SixMinute/ANEResourcesBugExampl… gets R.java, which contains it's *only* entry (com_chartboost_fragment), but also *all* the other R entries that should be in src/com/facebook/android - ANEResourcesBugExample/ANE3Source/src/com/facebook/android at multiple_resource_anes · SixMinute/ANEResourcesBugExample …, but aren't.

So while the other bug is correct, I don't think it's thorough enough, nor gets to the whole problem.

seaders6mAuthor
Known Participant
May 20, 2014

Sorry, and also, at this point, all the R files are also still in ANEResourcesBugExample/ANE3Source/src/air/com/sixminute/ANE3Test/debug at multiple_resource_anes · SixMinute/ANEResource… .  So the only place it *doesn't* go to is where those R files were generated from, and were supposed to go to, src/com/facebook/android.