Forum Xamarin.Android

Troubles using Resources from Library project

CheesebaronCheesebaron DKInsider, University mod

I am in the midst of putting my MonoDroid.ActionBar into a Library, because it is super messy to have to copy over a ton of files in new projects, rather than just referencing a Library project with all the relevant classes and resources.

The project can be found here: https://github.com/Cheesebaron/MonoDroid.ActionBar/tree/library

The library builds fine and stuff is defined in Resource.designer.cs; however I have some trouble getting my sample application working. I hit a lot of errors when the build tries to run UpdateResGen:

    Target _UpdateAndroidResgen:
          AdditionalResourceDirectories: 
        Tool /Users/tcielecki/android-sdk-macosx/platform-tools/aapt execution started with arguments: package -f -m -M /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/jqblf8t3.n46/AndroidManifest.xml -J /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/jqblf8t3.n46 --custom-package monodroid.actionbar.sample -F /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/jqblf8t3.n46/resources.apk.bk -S obj/Debug/res/ -I /Users/tcielecki/android-sdk-macosx/platforms/android-14/android.jar --auto-add-overlay --debug-mode 
        W/ResourceType(22127): Bad XML block: no root element node found
        W/ResourceType(22127): Bad XML block: no root element node found
        W/ResourceType(22127): Bad XML block: no root element node found
        Resources/layout/fragment_tabs.xml(2): error: No resource found that matches the given name (at 'style' with value '@style/ActionBar').
        Resources/layout/main.xml(2): error: No resource identifier found for attribute 'title' in package 'monodroid.actionbar.sample'
        Resources/layout/main.xml(2): error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
        Resources/layout/main.xml(2): error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
        Resources/layout/main.xml(2): error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
        Resources/layout/main.xml(2): error: No resource found that matches the given name (at 'style' with value '@style/ActionBar').
        Resources/layout/main.xml(2): error: No resource found that matches the given name (at 'separator' with value '@color/actionbar_separator_alt').
        Resources/layout/main.xml(2): error: No resource found that matches the given name (at 'background' with value '@drawable/actionbar_background_alt').
        Resources/layout/main.xml(2): error: No resource found that matches the given name (at 'background_item' with value '@drawable/actionbar_btn_alt').
        Resources/layout/other.xml(2): error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
        Resources/layout/other.xml(2): error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
        Resources/layout/other.xml(2): error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
        Resources/layout/other.xml(2): error: No resource found that matches the given name (at 'style' with value '@style/ActionBar').
        Resources/layout/other.xml(2): error: No resource found that matches the given name (at 'style' with value '@style/ActionBar').
        Resources/layout/other.xml(2): error: No resource found that matches the given name (at 'separator' with value '@color/bottomactionbar_separator').
        Resources/layout/other.xml(2): error: No resource found that matches the given name (at 'background' with value '@drawable/bottomactionbar_background').
        Resources/layout/other.xml(2): error: No resource found that matches the given name (at 'background_item' with value '@drawable/bottomactionbar_btn').
        Resources/menu/mainmenu.xml(14): error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_search').
        Resources/menu/mainmenu.xml(14): error: No resource found that matches the given name (at 'title' with value '@string/menu_string_search').
        Resources/menu/mainmenu.xml(14): error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_refresh').
        Resources/menu/mainmenu.xml(14): error: No resource found that matches the given name (at 'title' with value '@string/menu_string_refresh').
        Resources/menu-v11/mainmenu.xml(14): error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_action_search_dark').
        Resources/menu-v11/mainmenu.xml(14): error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_action_refresh_dark').
        Resources/menu/othermainmenu.xml(14): error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_search').
        Resources/menu/othermainmenu.xml(14): error: No resource found that matches the given name (at 'title' with value '@string/menu_string_search').
        Resources/menu/othermainmenu.xml(14): error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_refresh').
        Resources/menu/othermainmenu.xml(14): error: No resource found that matches the given name (at 'title' with value '@string/menu_string_refresh').
/Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.Common.targets: error : Tool exited with code: 1. Output: W/ResourceType(22127): Bad XML block: no root element node found
W/ResourceType(22127): Bad XML block: no root element node found
W/ResourceType(22127): Bad XML block: no root element node found
obj/Debug/res/layout/fragment_tabs.xml:1: error: Error: No resource found that matches the given name (at 'style' with value '@style/ActionBar').
obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'title' in package 'monodroid.actionbar.sample'
obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
obj/Debug/res/layout/main.xml:1: error: Error: No resource found that matches the given name (at 'style' with value '@style/ActionBar').
obj/Debug/res/layout/main.xml:1: error: Error: No resource found that matches the given name (at 'separator' with value '@color/actionbar_separator_alt').
obj/Debug/res/layout/main.xml:1: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/actionbar_background_alt').
obj/Debug/res/layout/main.xml:1: error: Error: No resource found that matches the given name (at 'background_item' with value '@drawable/actionbar_btn_alt').
obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
obj/Debug/res/layout/other.xml:1: error: Error: No resource found that matches the given name (at 'style' with value '@style/ActionBar').
obj/Debug/res/layout/other.xml:1: error: Error: No resource found that matches the given name (at 'style' with value '@style/ActionBar').
obj/Debug/res/layout/other.xml:1: error: Error: No resource found that matches the given name (at 'separator' with value '@color/bottomactionbar_separator').
obj/Debug/res/layout/other.xml:1: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/bottomactionbar_background').
obj/Debug/res/layout/other.xml:1: error: Error: No resource found that matches the given name (at 'background_item' with value '@drawable/bottomactionbar_btn').
obj/Debug/res/menu/mainmenu.xml:13: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_search').
obj/Debug/res/menu/mainmenu.xml:13: error: Error: No resource found that matches the given name (at 'title' with value '@string/menu_string_search').
obj/Debug/res/menu/mainmenu.xml:13: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_refresh').
obj/Debug/res/menu/mainmenu.xml:13: error: Error: No resource found that matches the given name (at 'title' with value '@string/menu_string_refresh').
obj/Debug/res/menu-v11/mainmenu.xml:13: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_action_search_dark').
obj/Debug/res/menu-v11/mainmenu.xml:13: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_action_refresh_dark').
obj/Debug/res/menu/othermainmenu.xml:13: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_search').
obj/Debug/res/menu/othermainmenu.xml:13: error: Error: No resource found that matches the given name (at 'title' with value '@string/menu_string_search').
obj/Debug/res/menu/othermainmenu.xml:13: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_refresh').
obj/Debug/res/menu/othermainmenu.xml:13: error: Error: No resource found that matches the given name (at 'title' with value '@string/menu_string_refresh').

However if I set the compile property of the files which it complains about the Resource.designer.cs file gets update and it actually seems like it finds all the stuff from the Library project. Stylables, Drawables etc. which it complains about in the UpdateResGen process. How do I proceed from here. It would be really nice to have the MonoDroid.ActionBar live in a Library.

I am attempting to get this to work in MonoDevelop on a Mac which is on the Alpha Channel (I like new stuff :D ).

Posts

  • StuartLodgeStuartLodge USBeta ✭✭✭

    I tried the same thing (with the same library) - seems like it might have been a VS issue?

    http://forums.xamarin.com/discussion/831/resource-files-in-library-projects/p1

  • ManskiManski DEMember

    Not sure whether it's related but in my case my layouts had upper case characters in their file names and that's what threw MfA off.

  • CheesebaronCheesebaron DKInsider, University mod

    Well I can tell you it works just fine when not using MonoDroid.ActionBar in a library. But I can try lowercasing file names and see if that helps.

  • CheesebaronCheesebaron DKInsider, University mod
    edited February 2013

    That did not help much. It still has troubles finding stuff from the library. This time it is the attrs.xml definitions:

        Target _UpdateAndroidResgen:
              AdditionalResourceDirectories: 
                obj/Debug/__library_projects__/MonoDroid.ActionBar.Library/library_project_imports/res
            Tool /Users/tcielecki/android-sdk-macosx/platform-tools/aapt execution started with arguments: package -f -m -M /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/i2rple06.n0c/AndroidManifest.xml -J /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/i2rple06.n0c --custom-package monodroid.actionbar.sample -F /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/i2rple06.n0c/resources.apk.bk -S obj/Debug/res/ -S obj/Debug/__library_projects__/MonoDroid.ActionBar.Library/library_project_imports/res -I /Users/tcielecki/android-sdk-macosx/platforms/android-14/android.jar --auto-add-overlay --debug-mode 
            Resources/layout/main.xml(2): error: No resource identifier found for attribute 'title' in package 'monodroid.actionbar.sample'
            Resources/layout/main.xml(2): error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
            Resources/layout/main.xml(2): error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
            nothing matches overlay file mainmenu.xml, for flavor ,,,,,,,,,,,,,,,,,,v11
            Resources/layout/main.xml(2): error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
            Resources/layout/other.xml(2): error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
            Resources/layout/other.xml(2): error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
            Resources/layout/other.xml(2): error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
    /Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.Common.targets: error : Tool exited with code: 1. Output: obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'title' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
    nothing matches overlay file mainmenu.xml, for flavor ,,,,,,,,,,,,,,,,,,v11
    obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample' 
    

    It is funny, because if you look in the Resource.designer.cs the Stylables are generated:

    public partial class Styleable
    {
    
        public static int[] ActionBar = new int[]
        {
                2130771968,
                2130771969,
                2130771970,
                2130771971,
                2130771972};
    
        // aapt resource value: 3
        public const int ActionBar_background = 3;
    
        // aapt resource value: 4
        public const int ActionBar_background_item = 4;
    
        // aapt resource value: 2
        public const int ActionBar_separator = 2;
    
        // aapt resource value: 0
        public const int ActionBar_title = 0;
    
        // aapt resource value: 1
        public const int ActionBar_title_color = 1;
    
        private Styleable()
        {
        }
    }
    
  • aaronmixaaronmix USMember, Beta

    Interesting! I am also trying to convert MonoDroid.ActionBar to a library project. I actually had the similar issue. I just lowercased names in Resources, and it can compile at least.

    See the commit: https://github.com/aaronmix/MonoDroid.ActionBar/commit/5e8fefa865efa9de87df36e31f0e924139f2d702

    However, I can't get it running in sample application. Seems like xml namespace issue.

  • AtsushiEnomotoAtsushiEnomoto JPMember, Xamarin Team Xamurai

    Hello,

    I have some ideas on the cause of the problem: 1) as some of you have noticed, unlike applications, resource names must be in lowercase [1] because the resources in library is dealt almost the same as Jar binding's resources (which must be always in lowercase). And 2) resource IDs are not always updated due to inconsistent status between the library and the application, resulting in build failure at application [2]. If you are seeing uppercase resource IDs then it is likely due to this issue. In that case, rebuilding the library dll and then making some changes in application resources may workaround the issue.

    I am working on those issues as long as other breaking issues run in. Sorry for the inconvenience.

    [1] https://bugzilla.xamarin.com/show_bug.cgi?id=9370
    [
    2] https://bugzilla.xamarin.com/show_bug.cgi?id=10078

  • AtsushiEnomotoAtsushiEnomoto JPMember, Xamarin Team Xamurai

    There is actually another issue regarding the latest Tomasz's comment: you will have to set API Level to 14 to include those resources, otherwise android aapt will exclude them. (It was an already reported issue regarding ActionBarSherlock sample for Jar binding project.)

    It is also now under investigation on how to deal with these API level difference (dealing with API level needs some different consideration between Java and Mono) for the best dev. experience.

  • StuartLodgeStuartLodge USBeta ✭✭✭

    Thanks @eno - having this functionality working is going to make reusing UI across projects really powerful. Looking forwards to saying goodbye to one big resources/layout folder with hundreds of files in it!

  • CheesebaronCheesebaron DKInsider, University mod

    Going to test this out tomorrow to see if I can get it to work. However, setting API level to 14 defeats the purpose of the library to support API levels pre level 10, which do not have the ActionBar implemention, so I am looking forward to the results of your investigations @eno.

    If you need me to test anything, please do not hesitate to contact me :)

  • AtsushiEnomotoAtsushiEnomoto JPMember, Xamarin Team Xamurai

    @Cheesebaron yes, agreed. Still, what if you remove *-14 resources from your project? It's absolutely better if you don't need to do it per API level, but it might be still better than nothing for you if it works.

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    setting API level to 14 defeats the purpose of the library to support API levels pre level 10

    Does it? An app can target a later API level and still execute on an earlier API level, so you could have the app target API 14+ with a minimum API of e.g. 8, and use runtime checks to access resources only on appropriate devices.

  • CheesebaronCheesebaron DKInsider, University mod

    So it would be OK, to set min API level to 14 on the library and then use it in the sample, where it has a lower min level and a target of 14?

  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    I believe that should be OK; iirc the target & minimum API levels in the Library project aren't used in the App project except indirectly (e.g. does aapt complain about the resources obtained from the Library project?).

  • CheesebaronCheesebaron DKInsider, University mod

    I will try that tomorrow and see how that goes :)

  • CheesebaronCheesebaron DKInsider, University mod
    edited February 2013

    I've now made sure everything in the Library is lowercase, however it is still not possible to use attributes from the library it seems.

    public partial class Attribute
    {
    
        // aapt resource value: 0x7f010003
        public const int background = 2130771971;
    
        // aapt resource value: 0x7f010004
        public const int background_item = 2130771972;
    
        // aapt resource value: 0x7f010002
        public const int separator = 2130771970;
    
        // aapt resource value: 0x7f010000
        public const int title = 2130771968;
    
        // aapt resource value: 0x7f010001
        public const int title_color = 2130771969;
    
        private Attribute()
        {
        }
    }
    

    They are defined in the Resource.designer.cs and are present in the UpdateIdValues:

    public static void UpdateIdValues()
    {
        MonoDroid.ActionBar.Library.Resource.Attribute.background = MonoDroid.ActionBar.Sample.Resource.Attribute.background;
        MonoDroid.ActionBar.Library.Resource.Attribute.background_item = MonoDroid.ActionBar.Sample.Resource.Attribute.background_item;
        MonoDroid.ActionBar.Library.Resource.Attribute.separator = MonoDroid.ActionBar.Sample.Resource.Attribute.separator;
        MonoDroid.ActionBar.Library.Resource.Attribute.title = MonoDroid.ActionBar.Sample.Resource.Attribute.title;
        MonoDroid.ActionBar.Library.Resource.Attribute.title_color = MonoDroid.ActionBar.Sample.Resource.Attribute.title_color;
    

    However I get the errors:

    MonoDroid.ActionBar\MonoDroid.ActionBar.Sample\Resources\layout\main.xml(2): error : No resource identifier found for attribute 'title' in package 'monodroid.actionbar.sample'
    MonoDroid.ActionBar\MonoDroid.ActionBar.Sample\Resources\layout\main.xml(2): error : No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
    MonoDroid.ActionBar\MonoDroid.ActionBar.Sample\Resources\layout\main.xml(2): error : No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
    MonoDroid.ActionBar\MonoDroid.ActionBar.Sample\Resources\layout\main.xml(2): error : No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
    MonoDroid.ActionBar\MonoDroid.ActionBar.Sample\Resources\layout\other.xml(2): error : No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
    MonoDroid.ActionBar\MonoDroid.ActionBar.Sample\Resources\layout\other.xml(2): error : No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
    MonoDroid.ActionBar\MonoDroid.ActionBar.Sample\Resources\layout\other.xml(2): error : No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
    

    I have also changed the API level of the Library to 14, this does not change anything at all.

    https://github.com/Cheesebaron/MonoDroid.ActionBar/tree/library

  • AtsushiEnomotoAtsushiEnomoto JPMember, Xamarin Team Xamurai

    Hello @Cheesebaron,

    I just tried your up to date solution and it just built out of the box for me. I could run the cute samples :) Could you make sure to remove "bin" and "obj" from both library and sample app and retry?

  • CheesebaronCheesebaron DKInsider, University mod
    edited February 2013

    @eno are you sure you switched to the "library" branch? Because I have now both tried on a Windows 8 machine with VS2012 and a Mac with latest MonoDevelop, which both give me the same errors.

        Target _UpdateAndroidResgen:
              AdditionalResourceDirectories: 
                obj/Debug/__library_projects__/MonoDroid.ActionBar.Library/library_project_imports/res
            Tool /Users/tcielecki/android-sdk-macosx/platform-tools/aapt execution started with arguments: package -f -m -M /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/tx7phmnd.hl3/AndroidManifest.xml -J /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/tx7phmnd.hl3 --custom-package monodroid.actionbar.sample -F /var/folders/sx/r5yhrld97tn4q6j9lzvmrx_r0000gp/T/tx7phmnd.hl3/resources.apk.bk -S obj/Debug/res/ -S obj/Debug/__library_projects__/MonoDroid.ActionBar.Library/library_project_imports/res -j obj/Debug/__library_projects__/android-support-v4.jar -I /Users/tcielecki/android-sdk-macosx/platforms/android-14/android.jar --auto-add-overlay --debug-mode 
            Resources/layout/main.xml(2): error: No resource identifier found for attribute 'title' in package 'monodroid.actionbar.sample'
            Resources/layout/main.xml(2): error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
            Resources/layout/main.xml(2): error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
            Resources/layout/main.xml(2): error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
            Resources/layout/other.xml(2): error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
            Resources/layout/other.xml(2): error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
            Resources/layout/other.xml(2): error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
    /Library/Frameworks/Mono.framework/External/xbuild/Novell/Novell.MonoDroid.Common.targets: error : Tool exited with code: 1. Output: obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'title' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/main.xml:1: error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'separator' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'background' in package 'monodroid.actionbar.sample'
    obj/Debug/res/layout/other.xml:1: error: No resource identifier found for attribute 'background_item' in package 'monodroid.actionbar.sample'
    

    I have tried removing the bin and obj folders, this makes no difference.

  • AtsushiEnomotoAtsushiEnomoto JPMember, Xamarin Team Xamurai

    @Cheesebaron, oh doh, my bad. I seem to have tried with master.

    Now in "library" branch, I fixed the package names as follows and it built as a quick remedy:

    xmlns:ab="http://schemas.android.com/apk/res/MonoDroid.ActionBar.Sample"

  • CheesebaronCheesebaron DKInsider, University mod

    Thanks @eno I got it to build! That is a good start, however I am now running into other problems.

    In the ActionBar.cs constructor, I am inflating Resources\Layout\actionbar.axml, which seems to go well, when debugging the field it is inflated to has a value with one Child view. However when trying to run FindViewById<>() on it, everything returns null, and giving me NullReferenceExceptions as they are being access later in the ctor, where they get assigned values from the attributes set. It is like the Resource Id's don't match or something.

    I also noticed, that there are files with uppercase and lowercase when looking at GitHub in the Resources folders. However on my Windows machine I only see the lowercase ones. I guess it has something to do with the file system, but could that have anything to do with the problems I am seeing?

  • CheesebaronCheesebaron DKInsider, University mod
    edited February 2013

    Just to update, it does not work on Mac either.

    I just made a small function that traverses the view that gets inflated correctly and prints out all the children and siblings and prints out their type and id. Which gives me this:

    Type: RelativeLayout - Id: 2131296257
    Type: ImageView - Id: 2131296258
    Type: RelativeLayout - Id: 2131296259
    Type: ImageButton - Id: 2131296260
    Type: ImageView - Id: 2131296261
    Type: LinearLayout - Id: 2131296262
    Type: RelativeLayout - Id: 2131296263
    Type: ProgressBar - Id: 2131296264
    Type: ScrollingTextView - Id: 2131296265
    

    Types are correct and correspond with the ones in actionbar.xml I have compared them with the values in Resource.designer.cs in the Library project and they seem to match OK.

    public const int actionbar_home = 2131296257;
    public const int actionbar_home_logo = 2131296258;
    public const int actionbar_home_bg = 2131296259;
    public const int actionbar_home_btn = 2131296260;
    etc..
    

    However... When stepping through the ctor looking at the Id's they are the values from the Sample project. Hence there is a mismatch between the Id's and it is trying to access Id's not present in the layout. What is wrong here?

    Do I need to pass the Resource Id's from my Sample project back to the library in order for it to work?

  • CheesebaronCheesebaron DKInsider, University mod

    @eno, awesome stuff! It works as intended now :D Thanks for all the help!

  • StuartLodgeStuartLodge USBeta ✭✭✭

    Awesome stuff @eno

    This is just awesome - having ActionBar, SlidingMenu, Dialog, etc as easily reusable controls is completely fab :)

  • AtsushiEnomotoAtsushiEnomoto JPMember, Xamarin Team Xamurai

    Glad to hear that, thanks for the patience and repetitive help!

    Next (non-trivial) release should include all those fixes and won't need those workarounds :)

  • Newky2kNewky2k GBMember, Beta
    edited February 2013

    Do you know when the "Release" will be available as i'm having the same problem with layout files. They are not in an external library but in the main application.

  • AsherAsher USMember
    edited April 2013

    @StuartLodge are you talking about a sliding menu for android?

  • Hi guys .
    for these errors , i just change "Compile using Android version" from "Android 5" to "Android 4.4" , and some minimum Android target , and Building solution work properly!
    Thank you @AtsushiEnomoto

Sign In or Register to comment.