Closed parmendrahsc closed 5 months ago
Any Update ??
I want MvvmCross with two core libraries
The Resource.designer.cs file contains the id's for all the compiled resources to be used on android.
For application projects these will be public const int
however to library projects we need to use public static int
.
This is because when you ship a library project and id
that is used for the final application can and does change. As a result we need to update the library values at runtime.
If you look at an application Resource.designer.cs
you will see code like this
public static void UpdateIdValues()
{
global::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::LinkTest.Droid.Resource.Attribute.actionBarSize;
}
The code above is making sure that the Xamarin.Forms android platform is using the same idea for the actionBarSize
as the one that was finally generated for the app. There isn't really a way around this since library projects can be shipped in binary form (via Nuget etc).
@dellis1972 for resolving this issue I have create Two Android project and one core library but now I get white blank screen. Attached Sample: https://drive.google.com/file/d/1H0zD9_0z-MNRv5taNo3k2MyNBHBImHag/view?usp=drive_web
@dellis1972 so what you are saying it that it is not possible to use in an Andorid Library project? Is it a valid thing even today?
@EmilAlipiev because of the way the android resource system works we cannot make library projects use const
so they will always need to be static
.
Steps to Reproduce
Expected Behavior
It should run without error.
Actual Behavior
Severity Code Description Project File Line Suppression State Error CS0182 An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type Ab.MyScan.Core.Droid C:\Users\e01699\Desktop\Framework\Ab.MyScan\Ab.MyScan\Ab.MyScan.Core.Droid\Views\Home\HomeFragment.cs 15 Active
Version Information
Microsoft Visual Studio Professional 2017 Version 15.9.4 VisualStudio.15.Release/15.9.4+28307.222 Microsoft .NET Framework Version 4.7.03056 Xamarin 4.12.3.77 (d15-9@e3f40b477) Xamarin Designer 4.16.13 (45a16efd4) Xamarin Templates 1.1.128 (6f5ebb2) Xamarin.Android SDK 9.1.4.2 (HEAD/8255f42fc) Xamarin.iOS and Xamarin.Mac SDK 12.2.1.12 (65ec520)