2 Replies Latest reply on Apr 12, 2013 5:04 PM by Kevin Sherrill

    Use native extensions

    community help Level 1
        • 1. Re:  Use native extensions
          williamjgrand Level 1

          Why doesn't hideAneLibSymbols exist for Android?  That is, the option doesn't exist under Build Packaging > Android and I get this error:

           

          Error occurred while packaging the application:

           

          aapt tool failed:/private/var/folders/05/d7xltrms59j0n1bplx_nvwrr0000gn/T/6a40a43b-082c-4b25-b8e4-d dad1c8d240a/res/layout/com_facebook_usersettingsfragment.xml:48: error: Error: No resource found that matches the given name (at 'style' with value '@style/com_facebook_loginview_silver_style').

          • 2. Re:  Use native extensions
            Kevin Sherrill

            Sorry, I don't know anything about hideAneLibSymbols.

             

            I too was having lots of resource missing problems until today. The following page is a must read for ane development. Solved all kinds of problems for me.

             

            http://www.adobe.com/devnet/air/articles/ane-android-devices.html

             

            In a nutshell, if I understand correctly, you'll do a "regular" export of your android jar file with your resources included (except for the res/xxhpdi sub-folder - if you have one. The actionscript side doesn't like this folder. Mmm, but maybe it would if I'd had a matching icon of the same size on the native side - I'll have to check on that.)

            I have a 'build' folder with 2 sub folders: android and default. (A setup very similar to the one discussed in the above article.)

            You'll put the jar file and a copy of the res folder (also excluding the xxhdpi sub-folder) into the android folder.

              (Yes you're doubling up your native resources in your ane file, but the resources in the jar will get stripped out and tossed when it gets merged into your app's final APK file.)

             

            I use a build batch file that pulls everything in from each sub folder using: -C android .

            (notice the period at the end)

             

            I think when I was having the error similar to yours was when I was trying to NOT double up the resources in the ane file and was exporting the jar without them. That won't work.

             

            For quite awhile I was having the opposite problem. I wasn't doubling up the resources, the ane file when "unzipped" looked fine, but android logcat kept reporting missing resource exceptions when running my test app via USB on my mobile device. When I finally stepped back and "unzipped" my apk file, sure enough, my native resources were gone and only the default Actionscript resources remained.

             

            Oh, and for Windows development I highly recommend 7Zip. It recognizes any file that's a zip no matter its file extension. I just right-mouse drag to a folder, select 7zip->extract here from the context menu, and it just works.

             

            Here's a copy of my windows batch file in case it helps anyone. It's from a sample project I rebuilt based off of mr_archano's

            sample SMS ane (on the Adobe ANE webpage):

             

            :: Builds ane after file all the necessary files have already been copied into place.

            :: Separate batch file that sets the path to may current AIR SDK

            call c:\bin\setAIRpath.bat

             

            :: Target name

            set targName=Archano.ane

            set extxml=extension.xml

            set swcName=ArchanoLib.swc

             

            :: Substitute your own p12 file here

            set certP12=\Flash/MyGamesInc.p12

             

            :: Change pwd as needed.

            set pwd=useyourownpwd

             

            set paccmd=adt

             

            %paccmd% -package -storetype pkcs12 -keystore %certP12% -storepass %pwd% -target ane %targName% %extxml% -swc %swcName% -platform Android-ARM -C android . -platform default -C default .

             

            Also, I built using the AIR 3.7 SDK overlaid as per the doc above describes (although it used AIR 3.6)

            The only problem I've having now is that my apk just jumped from 1.5Mb to 11.7Mb. Ouch.

            I tried rolling my targeted platform from 20 back to -swf-version=14 but that doesn't seem to have helped.

            Back to scanning the forums for help on that one. *sigh*