Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Even with the latest fixes in Android library binding, there are still some issues that needs fixes, e.g. to get ActionBarSherlock *samples* working (the binding itself should already build).
- Resource names in the android library project and the managed application project often conflicts, while they should be actually different (by package name). Currently we *overwrite* the resources when the containing files names overlap. I think this was what what Android SDK used to do, now it became better at their side and we should follow.
- Android library resources could be referenced by the application project code, as a member of R.* class where the R class is *from the library project* (not the R class from the app project). Here is an example:
I already have a fix for the first issue. The second needs some work.
The former issue is now fixed.
For the latter issue, I noticed that we should *not* be generating Resource class within the library project binding dll, because 1) the resource IDs will be changed later for exactly the same reason as IDs in the Android library project R.java cannot be constant, and 2) it will later conflict with the resource in the application project.
Instead of generating IDs in the library project, it should rather be generated in the application project's Resource.designer.cs. In the previous resource designer bugfix, I explicitly made changes to C# resource designer generator to *skip* non-app resources (as it prevented generating sane code somehow), but now it is likely time to make it working and activate again.
Actually the latter issue should *not* matter; the Resource.designer.cs within the app *.csproj should describe *everything* that will be ultimately packaged in the arsc/apk and the corresponding field for the ID should also be there.
What I was missing was that the Resource.designer.cs in my test .csproj had *different* default namespace than the namespace I used in the test activity and thus resulted in ordinal type resolution failure.
Created attachment 2228 [details]
Actually there still seems some resource resolution issue regarding aapt:
Tool /home/atsushi/android-sdk-linux/platform-tools/aapt execution started with arguments: package -f -m -M obj/Debug/android/AndroidManifest.xml -J /tmp/3f4o3s9u.3iy --custom-package actionbarsherlocktest.actionbarsherlocktest -F obj/Debug/android/bin/packaged_resources.bk -S obj/Debug/res/ -I /home/atsushi/android-sdk-linux/platforms/android-15/android.jar -A /svn/monodroid-samples/ActionBarSherlock/ActionBarSherlockTest/obj/Debug/assets/ --extra-packages com.actionbarsherlock --auto-add-overlay
Resources/values/themes.xml(5): error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.DarkActionBar'.
Resources/values/themes.xml(6): error: No resource found that matches the given name: attr 'actionBarStyle'.
Resources/values/themes.xml(9): error: Error retrieving parent for item: No resource found that matches the given name 'Widget.Sherlock.Light.ActionBar.Solid.Inverse'.
Resources/values/themes.xml(10): error: No resource found that matches the given name: attr 'background'.
Resources/values/themes.xml(13): error: No resource found that matches the given name: attr 'backgroundSplit'.
Tool /home/atsushi/android-sdk-linux/platform-tools/aapt execution finished.