packageName question when building an Android ANE

Hi,
I'm trying to implement an external library ANE wrapper for Android.
I'm always receiving "class not found" error message in LogCat. No problem accessing native code, but when I try to access to external library functions it fails.
I've tried
External library inside Air native extension for android
How to include additional Jar in Android Native Extension for Adobe Air Mobile - Stack Overflow
Unsuccessfuly.
Reading these docs: Adobe Flash Platform * Including resources in your native extension package I think I could have a problem loading the resources and, because of that, not access to the class properly or crashing somewhere.
My platformoptions file
<platform xmlns="http://ns.adobe.com/air/extension/17.0">
    <packagedDependencies>
        <packagedDependency>my_sdk.jar</packagedDependency>
    </packagedDependencies>
  <packagedResources>
  <packagedResource>
  <packageName>com.my_sdk</packageName>
  <folderName>res</folderName>
  </packagedResource>
  </packagedResources>
</platform>
My question is, how can I know the "packageName", "res" is the folder where I copied and pasted all the resources from the external library, but the package? I've just written randomly "com.my_sdk"
Thanks!

To create Android ANE there is a devnet article Developing and using Adobe AIR native extensions for Android devices | Adobe Developer Connection
Accessing third-party native libraries
The original purpose of native extensions was to provide access to native platform features that were not currently covered by the ActionScript API. However, many ActionScript developers targeting Android have expressed a strong interest in taking advantage of available third-party Android libraries that package together a number of popular Android-specific functions, so that they need not reimplement those functions in ActionScript. To use any third party library jar in your project you can use the R* mechanism. For more information, see Developing Native Extensions Guide.
Working with arbitrary assets
In addition to accessing Android native resources, developers often need to access arbitrary resources for assets such as drawables and sound files. These assets are frequently found packaged in arbitrary dependent JAR files instead of a central location, especially for third-party native libraries. To use such assets in your project you can use the R* mechanism. For more information, see Developing Native Extensions Guide.
Adobe help doc to use R* mechanism Adobe Flash Platform * Including resources in your native extension package

Similar Messages

  • NoClassdefFoundError on the third-party jar's classes when building APK

    I am building a native extension for Android.
    For the android library, I create a android project and add several third-party jar files to build path.
    I extract a jar file from a android project and merge it and third-party jar files into a single jar file.
    I package ANE using a merged jar file and build a APK.
    When I install a APK and launch it, NoClassdefFoundError on the third-party class occurs.
    I use Flash Builder 4.6 and set sdk version to the Flex SDK 4.6.0 + AIR SDK 15.0.0.356.
    I decompile APK and check the classes.dex.
    Strangely a certain jar's classes are missing in the classes.dex.
    I tried googling and found a similar case.
    The following is the link :
    http://stackoverflow.com/questions/24777394/noclassdeffounderror-on-thirdparty-class-files -when-building-adobe-native-extens
    I try to follow the answer in this link.
    Did dx.jar in the AIR SDK really strip out some classes of third-party jar file??
    I inquired the java version of the third-party related with NoClassdefFoundError.
    Now I am waiting for the reply.
    Is anybody else know about this?

    The android-support-v4.jar is same.
    I check android-support-v4.jar's classes in ANE.
    But they are missing in APK after release build.
    I don't know why.
    I use Flash Builder 4.6 and Flex SDK 4.6.0 + AIR SDK 15.0.0.356.
    Is there anyone else know about this???

  • Android ANE PackagedResources Bug

    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

    Ok, I'm now building with Java 8, and it is better but definitely still not right.  I'm now at the state of Milkman's bug, where the R.java is only constructed for one of the ANEs, but not all.  Again, I've pushed all my files to SixMinute/ANEResourcesBugExample · GitHub.
    @Nitisha, while it looked like all was alright previously, on checking again, it only looked like all was right because ANE2 wasn't referencing any resources.  Now though, on tap of "Initialise", we do
                ANE2Extension.DLog("test resource");
                try {
                    ANE2Extension.DLog("id: '" + R.layout.com_chartboost_fragment + "'");
                } catch (Exception e) {
                    ANE2Extension.DLog( e + " - " + e.getLocalizedMessage() );
                ANE2Extension.DLog("test resource over");
    But that resource cannot be found, and in LogCat, we also see the error
    VFY: unable to resolve static field 1673 (com_chartboost_fragment) in Lcom/chartboost/android/R$layout;
    But doing the exact same with ANE1,
                ANE1Extension.DLog("test resource");
                try {
                    ANE1Extension.DLog("id: '" + R.layout.com_facebook_login_activity_layout + "'");
                } catch (Exception e) {
                    ANE1Extension.DLog( e + " - " + e.getLocalizedMessage() );
                ANE1Extension.DLog("test resource over");
    works perfectly,
    05-22 15:39:24.285: I/ANE1(29554): test resource
    05-22 15:39:24.285: I/ANE1(29554): id: '2130903042'
    05-22 15:39:24.285: I/ANE1(29554): test resource over
    For the moment, for our project, while imperfect, this is acceptable.  The only 3rd party library with loads of resources we're using is Facebook, so for that guy, we can just leave him be, but getting this sorted at some stage really would be great.
    Thanks for all your help thus far.

  • Adding Booking Type Field When Building Teams via Resource Plans

    Question for the Project Server 2010 experts out there...
    When building a team for a Resource Plan via PWA, the Booking Type field does not display on the right side of the page (PWA/RM/BuildResPlanTeam.aspx) which makes it difficult to change the resource from Committed (our default) to Proposed. 
    Is there any way to add the field? 
    I do realize that after building your team you can drill into each resource and change the Booking Type using the "Edit Cutom Fields" function, however, the Booking Type field displays when building your team for Project so it seems odd
    that the field does not diplay when building a team for Resource Plans.
    Thanks!

    jebrabazon2,
    1) When you are changing the Booking Type using the "Edit Custom Fields:, you are actually changing the Resource's Default Booking Type across PWA, and not just for that Resource Plan.
    2) I agree that it would be intutive to have the  "Build Team"
    within the Projects vs. Resource Plans be the same, and I am not sure why there is a discrepancy, but here is a solution. You can display the booking type field within the "Resource Plan" view, so that users do not have to drill down into
    each resource. Please see the image below (from 2013, but applies to 2010).
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • Why use ojdeploy when building ViewController jar/war?

    Hi,
    It is known that ojdeploy is the recommended way to go when building/deploying an ADF app. The advantages are stated in many blog posts in the web.
    IMHO the most important reason for using ojdeploy instead of javac when creating an EAR is that javac CANNOT validate your BC. This means for example that if you refactor-rename an attribute of a VO and then commit only xml and not the related View Row Impl class, the build in your CI server will succeed if using only javac and fail if using ojdeploy (as it should be). So ojdeploy is the only way when building jars of Model projects if you want to be 100% sure the you have valid ADF code.
    The question is if the is a similar reason for using ojdeploy when building ViewController jars/wars??
    Thanx in advance for any feedback.
    Spyros Doulgeridis
    adfhowto.blogspot.com
    Edited by: spido on Jul 6, 2011 10:04 AM

    ojdeploy makes changes to your descriptors javac or jar does not know about. Actually nobody knows about the changes as you have to look into the war to see them. I'm not even sure that they are documented.
    Timo

  • Release build error with ANE "AOT Compilation has failed while optimizing function"

    I'm trying to use the ChartBoost ANE which can be downloaded here https://github.com/freshplanet/ANE-Chartboost
    When I do an Ad-hoc release build It keeps crashing and giving me the error below when packaging for iOS. But if I do a debug build that's a "fast" or "standard" build it compiles fine, and I can even see the ads.
    Why would it crash when doing a release build? Does this ANE need an update?
    I'm using FB 4.7 and AIR 3.8. Specifically, Apache Flex 4.10 Air 3.8
    If I remove this 1 line of the Chartboost ANE code "AirChartboost.getInstance().showInterstitial();", the release build compiles fine and I can put it on the test iOS device.
    "Error occurred while packaging the application:
    AOT Compilation has failed while optimizing function public::AdsHelper.showFullscreenAd
    Exception in thread "main" java.lang.NullPointerException
    at java.util.TreeMap.getEntry(TreeMap.java:324)
    at java.util.TreeMap.containsKey(TreeMap.java:209)
    at adobe.abc.GlobalOptimizer.sccp_eval(GlobalOptimizer.java:6150)
    at adobe.abc.GlobalOptimizer.sccp_analyze(GlobalOptimizer.java:6019)
    at adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4733)
    at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3615)
    at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:2309)
    at adobe.abc.LLVMEmitter.optimizeABCs(LLVMEmitter.java:534)
    at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:343)
    at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler.java:611)
    at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:104)
    Compilation failed while executing : ADT"

    I just encountered this error when building ad-hoc package, say that:
    Error occurred while packaging the application:
    AOT Compilation has failed while optimizing function apackage::AClass.aFunction
    After several tries It turns out that the error was because the function aFunction has a return before some other code (for testing). I commented the code after the return then the packaging works fine.
    FYI.

  • Error of heads when build the .dll by visual studio 2003

    I am trying to call the dll function in labVIEW which build by visual studio 2003.
    while I compile the basic program in visual studio 2003,the dll will be built successfully,but if I include heads like or in my program, etc.Compiling has the error of ,so the dll can not be built.
    I have trued to look for the solution in NI Discussion Forums,but havent seen the related article about the error of including .
    If someone can answer this for me,that will be a great help,and I'll be so appreciate if anyone get me out
    of the trouble.
    Sean

    I'm a little unclear about your question. What is the exact error that you are receiving and at what point are you receiving it? Is the error occurring when calling the DLL in LabVIEW or is it occurring when building the DLL in Visual Studio? Further clarification about exactly what the problem is and where it is occurring would be a big help!
    Regards,
    E. Sulzer
    Applications Engineer
    National Instruments

  • Encore freezes when building dvd

    Hi
    I've got a problem. When I click "build dvd" in adobe encore, the program should pop up a window where I can click to build to dvd, to folder etc.
    Well the window pops up, but then the whole program freezes, en the mouse turns into a sand glass. I've tried to reinstall, but that didn't work.
    can somebody help me?

    After spending the last 48 hours trying to get through the same type of issues I am ready to throw CS3 out the window. I have had about 6 different scenarios with problems and error messages. None of the messages are on the adobe website, in the manuals and can't even be found on Google. I will try to form a "Good Forum question" when my patience has returned and my blood pressure drop. But Mr. Smith - you try dealing with lock ups and reboots to just put together a one hour video with your new $2000 software package and keep calm and collected enough to gracefully ask a proper forum question! I feel their pain!

  • Am being prompted to enter security questions when making a purchase on my new IPad.  I don't believe I have ever setup security questions on my apple id.  How to I create new security questions?

    I am being prompted to enter security questions when making a purchase on my new IPad.  I don't believe I have ever setup security questions on my apple id.  I have tried logging into my apple id and have chosen the security and priviacy settings to set up security questions.  However I am prompted to enter answers to security questions and am told they don't match.  How to I create new security questions or reset them? 

    You need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (104011)

  • I get a "vi is not executable" error when building an application.

    I have an ongoing project that has worked fine in the past when building an application. I have recently added some report generation toolkit vis(Excel) and get an error for some of the ni vis and some of my own that call lower level excel vis. The error is that he vi is not executable, however they run fine in the development environment. I do not get this error if I save all vi's into one llb with save with options command and then build. However, when I try to run the app, this error re-appears. Also, do I have to add the dynamically loaded vi's that are part of the toolkit in my build script? Could this be the cause of the problem? If so, what's the best way to find all of them? Any suggestions?

    You have hit in on the nail! You do need to add the dynamically loaded VIs when you are creating an executable from your VI. You need to add _wordsub.lib and _exclsub.lib as dynamically loaded VIs into your executable. Try this and let us know if you have any more problems with it.
    J.R. Allen

  • Why is it when I download music to my iTunes an explanation mark comes up on some of my music. And another question when I move some music to my iPod I can not play it because this little circle comes up

    Why is it when I am downloading my CD's to my computer some of my music gets an explanation mark next to it.
    Second question
    When I can download music to my iPod some of the music downloads but I can not play it because it has this little round circle in front of it ansd the music is greyed out and not black lettering like the other songs I can play.
    Please help

    katenater wrote:
    Thank you now how do I get the songs on to the flash drive?
    Insert the flash drive into the other computer, and open it so it looks like a window.  Highlight the songs you want in his iTunes, and drag them into that window.
    That will cause them to copy onto the flash drive, and will not affect his library.
    If you normally run iTunes in full-screen mode, make it smaller so that you can do the drag.
    Then insert the flash drive into your computer.  Find your Automatically Add to iTunes folder (it is inside the iTunes media folder) and drag the songs into it.

  • I just got a new ipad 2 and i can't buy stuff on it asks for security question when my apple id was right why

    i just got a new ipad 2 and i can't buy stuff on it asks for security question when my apple id was right why

    It's a security feature that was brought in a few months ago - when you try to purchase something for the first time on a new computer or device then you will be asked for the answers to your questions (or to set them up if you haven't yet created them).

  • I recently moved to Australia and received a new iphone with a local AUS number. I have a backup of my US iphone in the icloud. Question: when I activate my new AUS iphone which option should I choose - new phone or restore from backup?

    I recently moved to Australia and received a new iphone with a local AUS number. I have a backup of my US iphone in the icloud. Question: when I activate my new AUS iphone which option should I choose - new phone or restore from backup?  I would like to have all my contacts, email, etc. however wasn't sure that option was appropriate since it is a different/new number and a new phone.

    Yes, as new iPhone then restore from backup.

  • Error 1073 (on Clear Errors.vi) When Building Applicatio​n in LV 8.2

    I have seen numerous posts about this problem when building an application without a block diagram in LV 7.x, however, I am recieving this error on LV 8.2.  Whats most disturbing about it, is that it always hangs when processing Clear Errors.vi.  I have tried my source on two different machines, to no avail.  Also I tried to do a mass recompile of the entire vi.lib again no help.  It is very important that this program compiles, however I cannot get past this error.  Any suggestions?
    My specific error message is here:
    Visit the Request Support page at ni.com/ask to learn more about resolving this problem. Use the following information as a reference:
    Error 1073 occurred at ABAPI Dist disconnect td-poly.vi -> ABAPI Dist Chg and Save VIs.vi -> ABAPI Dist Build LLB Image.vi -> ABAPI Copy Files and Apply Settings.vi -> EBEP_Invoke_Build_Engine.vi -> EBUIP_Build_Invoke.vi -> EBUIP_Build_Invoke.vi.ProxyCaller
    Possible reason(s):
    LabVIEW:  This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.
    -Paul

    Hello Paul,
    I am sorry for not elaborating previously.  This issue has been documented previously for further investigation to our R&D group (# 3ZK9LGP2).  In the report I found that this error, though vague in the description, is fixed by enabling MathScript Support. 
    To enable MathScript support, check the checkbox in the application properties for the 'Enable MathScript support' option.
    -Bob
    -Bob

  • Flex 2 charting trial watermark appears when building via Ant

    The trial watermark appears when building with the flex Ant
    tasks, but not via Flex Builder 2. I believe the Ant tasks set up
    the compiler options with the same arguments in FB, and the build
    library path is also the same, but the trial watermark still
    appears.
    The charting source has been extracted into the Flex SDK 2
    directory, and the license key appears in the
    frameworks/license.properties file. As far as I know, these are the
    only steps needed to install the paid version of the charting
    tools. If I missed something, please let me know.
    Thanks in advance,
    KaJun

    Just an update on this issue:
    If I run the mxmlc compiler from the command line, I found
    that the output .swf does not have the watermark. It seems to be a
    bug in the Adobe Flex Ant tasks. I've changed the build script to
    use an exec call to the compiler instead.
    Thanks,
    KaJun

Maybe you are looking for