Bug? "res\values" missing in APK - ignored by B4A?

Discussion in 'Bugs & wishlist' started by gui4, Mar 8, 2015.

  1. gui4

    gui4 New Member Licensed User

    Hi,

    I'm getting the following error when my app starts.
    android.content.res.Resources$NotFoundException: Resource ID #0x0

    It uses a library which requires several XML (like android_content_strings.xml) in the "res\values" subfolder.
    I tried to place all of the XML files at "Objects\res\values" in my project's dir, marking them as read-only but B4A ignores them. If I open the APK (debug or release) in 7-zip, I don't see any "res\values" folder.

    I also tried to use a specific resource folder "myres\values", I used in code:
    #AdditionalRes: D:\My Documents\myproject\myres
    and all contents (including subfolders) from myres was compiled in "res" except the values subfolder!
    It's like B4A was coded to ignore the contents in this values subfolder.
    So how can we add it?

    Thank you!

    EDIT: I found this as a possible explanation, but I would like to have a confirmation from some experienced user: http://www.b4x.com/android/forum/threads/wrapping-android-library-projects.36410/
     
    Last edited: Mar 8, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    The compiler doesn't ignore this folder. The standard Android packager tool handles the resource folders (aapt).
    If this is a library project then you need to correctly use AdditionalRes (don't forget the package name).
     
  3. gui4

    gui4 New Member Licensed User

    Thank you very much. It was indeed a library so I built my wrapper with SLC and added string resources with #AdditionalRes and the corresponding wrapper name.
    Now it works fine and values are correctly compiled.
    If someone gets the same problem, you can check string values with: aapt.exe d strings "path to your apk"
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice