I need to transfer ownership but I can't seem to do it. I get an error about a lack of Xamarin platform license, but the person I'm transferring it to has a valid MSDN license. Any ideas?
Transfer of ownership
Xamarin Forms (iOS): This application is modifying the autolayout engine
Since I added translations between two ContentViews (to go from one to the other one nicely), I have the following logs:
This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
Stack:(
0 Foundation 0x0000000110da2ec6 _AssertAutolayoutOnAllowedThreadsOnly + 77
1 Foundation 0x0000000110da2b89 -[NSISEngine _optimizeWithoutRebuilding] + 61
2 Foundation 0x0000000110bb1ebb -[NSISEngine optimize] + 108
3 Foundation 0x0000000110da00ac -[NSISEngine performPendingChangeNotifications] + 84
4 UIKit 0x00000001116f89f9 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2211
5 QuartzCore 0x00000001138a63ee -[CALayer layoutSublayers] + 153
6 QuartzCore 0x00000001138aa4dd _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 401
7 QuartzCore 0x0000000113832ded _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 365
8 QuartzCore 0x000000011385e704 _ZN2CA11Transaction6commitEv + 500
9 MyProject.iOS 0x000000010f6bbd39 xamarin_dyn_objc_msgSend + 217
10 ??? 0x000000012f8e9462 0x0 + 5092840546
11 ??? 0x000000013025827c 0x0 + 5102731900
12 MyProject.iOS 0x000000010f5272c9 mono_jit_runtime_invoke + 1273
13 MyProject.iOS 0x000000010f5dbaa8 do_runtime_invoke + 88
14 MyProject.iOS 0x000000010f61bf9e start_wrapper + 718
15 libsystem_pthread.dylib 0x0000000117fe06c1 _pthread_body + 340
16 libsystem_pthread.dylib 0x0000000117fe056d _pthread_body + 0
17 libsystem_pthread.dylib 0x0000000117fdfc5d thread_start + 13
)
This is my code:
Device.BeginInvokeOnMainThread(async () =>
{
DetailContentView.Children.Insert(0, masterDetailContentView);
await DetailContentView.Children[1].TranslateTo(App.ScreenWidth - 100, 0, 250);
await DetailContentView.Children[1].TranslateTo(App.ScreenWidth, 0, 50);
DetailContentView.Children.RemoveAt(1);
});
where DetailContentView is a Grid, masterDetailContentView is the ContentView that will appear and DetailContentView.Children[1] is the ContentView that will disappear. I invoke that code in a MasterDetailPage, in an async method called UpdateDetailContentView that change the Content of MasterDetailPage.Detail.
This piece of code works but I want to remove the logs.
Thanks!
Memory Leak on ListView (due to ByteArrayToImageConverter)
I m using ByteArrayToImageConverter to convert byte array i m getting from SQL server databse , the converter as below
public class ByteArrayToImageConverter : IValueConverter
{
public ImageSource retSource;
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
// ImageSource retSource = null;
if (value != null)
{
byte[] imageAsBytes = (byte[])value;
// byte[] decodedByteArray = System.Convert.FromBase64String(Encoding.UTF8.GetString(imageAsBytes, 0, imageAsBytes.Length));
// var stream = new MemoryStream(decodedByteArray);
retSource = ImageSource.FromStream(() => new MemoryStream(imageAsBytes));
}
return retSource;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
//return null;
throw new NotImplementedException();
}
my problem when i show all the images in the xaml list view ( bind with my model) i m having memeory leaks , every time i open the list view the memory is growing gradually , Whast is the solution to reduce the memeor leaking issue with the converter and list view ( by the way i m using CachingStrategy="RecycleElement" but it dosent reduce the memory leak. please if anyone across this type of issue please let me know.
Thank you inadvance for your support.
Pan
Login with GitHub in Xamarin forms application
Hi All,
I need to integrate the GitHub login integration in my xamarin forms application using Xamarin Auth. I have used the below code using Oauth.
var auth = new OAuth2Authenticator(
clientId: Constants.GitHubClientId,
clientSecret:Constants.GitHubClientSecret,
scope: "",
authorizeUrl: new Uri(Constants.GitHubAuthorisationURL),
redirectUrl: new Uri(Constants.GitHubCallBackURL),
accessTokenUrl: new Uri(Constants.GitHubAccessTokenURL))
I can launch the GitHub login page and able to authenticate the application. But, i need to get the user details(Name, Email) of the logged in user. what is the API used for this purpose in GitHub login integration. I have been searching for the GitHub API to get the user details but to no avail. Can anyone please suggest the API to be used to get the user details.?
Thanks,
Vijay.
Swipe Gesture
Summary
At the moment there isn't a swipe gesture available in Xamarin.Forms, I think it would be a good addition to the library because it'll be cross platform and saves us adding third party libraries or custom renderers for straight forward app functionality.
API Changes
SwipeGestureRecognizer
Intended Use Case
We would be able to add a swipe gesture to any control in cross platform.
Editor inside Scrollview not scrolling.
I have an editor control inside a StackLayout which is inside a ScrollView. I can scroll all the controls but when I go into an editor control if the text superpasses the editor's height I cannot scroll into the previously added text. So if the line goes out of the visible part of the editor I cannot go back to it, the only way is to erase the whole text and write something up again. So basically trying to scroll inside the editor results in scrolling out the controls inside the scrollview but I just want to scroll inside the editor. By the way editors are added to the stacklayout dynamically.
<ScrollView>
<StackLayout x:Name="content" Orientation="Vertical"></StackLayout>
</ScrollView>
Any suggestions?
Thank you.
Console output shows different values from app display
I am using Syncfusion's sfSchedule and getting callback behaviour in an Android Forms app that has me completely baffled - I am getting different values in the debug log compared to what is drawn on the screen.
Their sample month cell drawing logic I customsed a little as shown below, so it would show the day/month in the cells. That works fine and the cells drawn show the expected values. However, the values dumped to the debug log are a month later. I know how stupid that sounds but I have tested it five times now, deleting from the device each time. I suspect this is a Xamarin problem but am extremely confused.
My testing process is
- Launch the app
- Clear the Application Output window
- Swipe the app to move from December to January 2018
Observe the new, incorrect output in the Application Output window
void Schedule_OnMonthCellLoadedEvent(object sender, MonthCellLoadedEventArgs e) { var dayStr = $"{e.date.Day}/{e.date.Month}"; Debug.WriteLine(dayStr); //****** writes different values to when dayStr is used below var monthCell = new StackLayout { BackgroundColor = Color.Transparent }; var monthLabel = new Label(); monthLabel.HeightRequest = 50; monthLabel.WidthRequest = 50; monthLabel.Margin = new Thickness(0, 0, 10, 10); monthLabel.BackgroundColor = Color.Green; monthLabel.Text = dayStr; //******** shows "correct" values from dayStr monthLabel.TextColor = Color.White; monthCell.Children.Add(monthLabel); e.view = monthCell; } void Schedule_OnVisibleDatesChanged(object sender, VisibleDatesChangedEventArgs e) { var firstDay = e.visibleDates[0]; var lastDay = e.visibleDates[e.visibleDates.Count - 1]; Debug.WriteLine($"Dates Changed: {firstDay.Day}/{firstDay.Month} to {lastDay.Day}/{lastDay.Month}"); }
AFTER A SWIPE
The device shows January 2018, as expected with a visible range drawn of 31/12 to 10/2
The debug log shows: (note - this list of strings is a month later than that displayed in the label using the same string.):
28/1
29/1
... deleted consecutive log lines to save space here
5/3
6/3
7/3
8/3
9/3
10/3
Dates Changed: 31/12 to 10/2
(note - the range in the "Dates Changed" event match the dates shown in the VISIBLE display)
Mac App rejected due to MapKit not being linked
My app was rejected from the Mac App Store for the following reason:
2.3 - Apps that do not perform as advertised by the developer will be rejected
The app still has the MapKit entitlement without linking against the MapKit framework.
My application targets the 64 bit architecture, links to the Native MapKit, associates the CFBundleIdentifier in Info.plist to the one created with Apple with Maps permissions. I am using the latest Stable releases of Xamarin.
Any thoughts on why this would happen?
Programmatically determine memory used by app?
To help monitor/track down memory leaks, we need to know what memory our app is consuming.
This is for a Xamarin.Forms app; currently we're only running on Android, but will be on iOS in the future.
I know we can get the OS memory used on the device, in the Droid project, by using code like below:
public static MemoryInfo GetMemoryInfo()
{
MemoryInfo retVal = new MemoryInfo();
retVal.MaxMemory = Java.Lang.Runtime.GetRuntime().MaxMemory();
retVal.FreeMemory = Java.Lang.Runtime.GetRuntime().FreeMemory();
retVal.TotalMemory = Java.Lang.Runtime.GetRuntime().TotalMemory();
return retVal;
}
Is there any mechanism for getting a figure for the memory being consumed in the Mono runtime?
OnPlatform Template Binding
Hi,
I try to add an Progressbar for iOS only. So I use "OnPlatform".
<tccontrols:ExtendedProgressBar
Grid.Row="0"
Grid.Column="0"
BackgroundColor="#f2dbba"
BarColor="#f49712"
HeightRequest="2.5"
HorizontalOptions="FillAndExpand"
Progress="{TemplateBinding PageLoadingProgress}">
<tccontrols:ExtendedProgressBar.IsVisible>
<OnPlatform
x:TypeArguments="x:Boolean"
iOS="{TemplateBinding ShowLoadingBar}"
Android="false"/>
</tccontrols:ExtendedProgressBar.IsVisible>
</tccontrols:ExtendedProgressBar>
This is, what my "ShowLoadingBar" looks like:
public static readonly BindableProperty ShowLoadingBarProberty =
BindableProperty.Create("ShowLoadingBar", typeof(Boolean), typeof(TC.App.Page.ExtendedWebViewPage), false);
And I got this error:
Position 70:38. Cannot assign property "iOS": Property does not exists, or is not assignable, or mismatching type between value and property
If I use that TemplateBinding as normal attribute IsVisible="{TemplateBinding ShowLoadingBar}"
it works finde...
What is wrong? Where is my mistake?
Xamarin UITest against Xamarin forms app built over .net standard 2
We are currently starting to build an app in .net standard 2, we are trying to add a UITest project to test the app.
We tried to make the uitest project .net standard 2 but we quickly found the packages are not currently supported, these include
- Xamarin.UITest
- Specflow
So we did think we could have the uitest project build and run in .net 4.5.2 as this is how we created it with our previous app.
But when we go to deploy and run the tests we get java virtual machine errors, it seems we are unable to have 2 projects in the same solution with 2 different .net frameworks versions
The issue is we are trying to create an app in .net standard 2 but none of the xamarin uitest packages seems ready for the framework
Any help would be hugely appreciated.
Where can I see my drafts?
Hi, I'm new to this forum.
I saved a draft for a question I wanted to ask about a week ago.
Where can I see it? I can't find any drafts.
Thanks.
Prism: View is not updated after setting value and calling RaisePropertyChanged in ViewModel ?
I was unable to bind the values to View from the Viewmodel, i can see the values are setting (ProductList) and invoking the RaisePropertyChanged while on debugging; I belive the code is right because while i set it as the firstpage in App.cs (NavigationService.NavigateAsync("StudentPage/NavigationPage/StudentRedeemPage");) ,it works but not works when its called/navigated from another page to StudentRedeemPage.
Xaml
`<?xml version="1.0" encoding="utf-8" ?>
<ContentPage.Content>
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Image Source="Icon"
VerticalOptions="Center"
HorizontalOptions="Center"
Grid.Column="1"
Grid.Row="0"/>
<StackLayout Grid.Column="0"
Grid.Row="0"
HorizontalOptions="CenterAndExpand"
VerticalOptions="Center">
<Label Text="REWARD SHOP"
TextColor="White"
FontSize="Medium"
FontAttributes="Bold"
VerticalTextAlignment="Center"
LineBreakMode="TailTruncation"/>
<Label Text="{Binding User_Profile_Table.Points_Earned, StringFormat='{0} Seeds'}"
TextColor="White"
FontSize="Large"
FontAttributes="Bold"
VerticalTextAlignment="Center"
LineBreakMode="WordWrap"/>
</StackLayout>
<StackLayout Grid.Row="1" Grid.ColumnSpan="2" >
<Label Text="Partners" BackgroundColor="{StaticResource RedeemTab}" HorizontalOptions="FillAndExpand" VerticalOptions="Center" />
<ListView
Margin="0,0,0,0"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
ItemsSource="{Binding ProductList}"
HasUnevenRows="true"
CachingStrategy="RecycleElement">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="0, 0, 10, 0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Image x:Name="Img"
Grid.Row="0" Grid.Column="0"
HorizontalOptions="Center"
VerticalOptions="Center"
HeightRequest="30"
WidthRequest="30"
Source="{Binding ImageUrl}"/>
<StackLayout Grid.Row="0" Grid.Column="1" VerticalOptions="Center">
<Label Text="{Binding SalesPriceIncVat,StringFormat='{0} Seeds'}"
TextColor="{StaticResource RedeemStatusBar}"
FontAttributes="Bold"
VerticalOptions="Center"/>
<Label Text="{Binding Name}"
VerticalOptions="Center"/>
</StackLayout>
<Button x:Name="btnRedeem"
Text="GET IT!"
TextColor="White"
BackgroundColor="{StaticResource RedeemLightGreen}"
Grid.Row="0" Grid.Column="2">
</Button>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</Grid>
</Grid>
</ContentPage.Content>
`
ViewModel
`public class StudentRedeemPageViewModel : NavigationViewModelBase
{
private List _productList;
public List ProductList
{
get { return _productList; }
set
{
SetProperty(ref _productList, value);
RaisePropertyChanged(nameof(ProductList));
}
}
private User_Profile_Table user_Profile_Table;
public User_Profile_Table User_Profile_Table
{
get { return user_Profile_Table; }
set
{
SetProperty(ref user_Profile_Table, value);
RaisePropertyChanged(nameof(User_Profile_Table));
}
}
private ProductModel _product_Table;
public ProductModel Product_Table
{
get { return _product_Table; }
set
{
SetProperty(ref _product_Table, value);
RaisePropertyChanged(nameof(Product_Table));
}
}
public DelegateCommand GetProductListCommand { get; private set; }
public DelegateCommand UserProfileCommand { get; private set; }
public DelegateCommand NavigateToRedeemPage { get; set; }
private IRequestProvider _requestProvider;
public StudentRedeemPageViewModel(IDeviceService deviceService, INavigationService navigationService,
IPageDialogService pageDialogService, IRequestProvider requestProvider)
: base(deviceService, navigationService, pageDialogService)
{
_requestProvider = requestProvider;
NavigateToRedeemPage = new DelegateCommand(() => NavigateCommand.Execute("VocherPage"));
GetProductListCommand = new DelegateCommand(async () => await GetProductList());
UserProfileCommand = new DelegateCommand(async () => await GetUserProfile());
UserProfileCommand.Execute();
GetProductListCommand.Execute();
}
async Task GetProductList()
{
List<Data> Test = new List<Data>();
string username = "admin@xxxx.com";
string password = "xxxxxxxxx";
string svcCredentials = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(username + ":" + password));
if (svcCredentials != null)
{
var client = new HttpClient();
client.BaseAddress = new Uri("https://xxxxxx.com/");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", svcCredentials);
var productsResponse = await client.GetAsync("xxxxxx/api/xxxx/");
var productsJson = productsResponse.Content.ReadAsStringAsync().Result;
ProductModel members = JsonConvert.DeserializeObject<ProductModel>(productsJson);
ProductList = members.Data;
}
}
async Task GetUserProfile()
{
User_Profile_Table = await _requestProvider.GetAsync<User_Profile_Table>(
GlobalSetting.Instance.UserProfileTableEndpoint, Settings.AuthAccessToken);
}
}`
Model
`public class ProductModel
{
public List Data { get; set; }
public string FirstItem { get; set; }
public string HasNextPage { get; set; }
public string HasPreviousPage { get; set; }
public string LastItem { get; set; }
public string PageNumber { get; set; }
public string PageSize { get; set; }
public string TotalItems { get; set; }
public string TotalPages { get; set; }
}
public class Data
{
[JsonProperty("Data")]
public string ProductId { get; set; }
public string PartnerId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string SalesPriceIncVat { get; set; }
public string SalesPriceExcVat { get; set; }
public string SalesVat { get; set; }
public string ValidFromDateUtc { get; set; }
public string ValidToDateUtc { get; set; }
public string TermsAndConditions { get; set; }
public string UsageInstructions { get; set; }
public string SlaTime { get; set; }
public string SlaText { get; set; }
public string Units { get; set; }
public string StockRequired { get; set; }
public string UseVariableValues { get; set; }
public string MinVariableValue { get; set; }
public string MaxVariableValue { get; set; }
public string VariableValueAllowedIncrements { get; set; }
public string ImageUrl { get; set; }
public string ImageCaption { get; set; }
public string CurrentStockBalance { get; set; }
}`
ERROR WITH LATEST NUGET v2.5.0.77 "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded
I just got latest stable 2.5.0.77107 and I can't compile anymore
[myUser]\packages\xamarin.forms\2.5.0.77107\build\netstandard1.0\Xamarin.Forms.targets(55,3): error MSB4062: The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly [myUser]\.nuget\packages\xamarin.forms\2.5.0.77107\build\netstandard1.0\Xamarin.Forms.Build.Tasks.dll. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
I replaced my user path with [myUser]
it looks like this bug exists since October in the pre-release:
Migrating to GitHub Issues and Projects
GitHub Issues
We're excited to announce GitHub Issues is now open on our repository. This is our new home for reporting bugs as well as discussing enhancement requests.
What does this mean?
- Bugzilla will remain open for the time being, and existing issues will continue to be worked there
- All new issues should be filed on GitHub
- The Evolution forum is being deprecated. Existing proposals will remain. New proposals and requests should be moved to GitHub Issues
GitHub Projects
GitHub Projects has also recently been made available to us and we are discussing how we will use it for tracking issues, features, and other work. Watch that space for an even higher level of visibility into everything going on with Xamarin.Forms.
Your project is not referencing the ".NETPortable,Version=v4.6,Profile=Profile44" framework. Add a r
I can't build my Xamarin.Forms project after I did a commit on it from Visual Studio for mac. now I keep getting this error, no matter what target do I choose:
Your project is not referencing the ".NETPortable,Version=v4.6,Profile=Profile44" framework. Add a reference to ".NETPortable,Version=v4.6,Profile=Profile44" in the "frameworks" section of your project.json, and then re-run NuGet restore.
iOS 11 - Carousel page issues
Hi, I updated my project to use the latest Xamarin forms and the latest iOS 11 build. Previously my carousel page seemed to just swipe left to right/right to left. But since the update the carousel page swipe seems to lift the whole page, so if I were to tap on the top right and swipe diagonally left, the whole page seems to move down and across leaving a white background while switching pages. See attached image of me moving my finger down a bit as I swipe. As well as looking odd, it seems to be causing issues with the pull to refresh i have on the page - the pull to refresh event is not being fired in some cases.
Please help...
Are shadows enabled?
I'm studying Urhosharp and I find it great.
I have now a problem with shadows.
I've downloaded the Samples and for example I see that the shadows are there (Physics example).
If I copy the example in a Xamarin Forms Urhosharp project, then the shadows disappear (Tested on UWP and Android).
The code is exactly the same (Physics demo).
Am I doing something wrong or the shadows are not available in a Xamarin Forms project?
Thanks
Visual Studio 2017 pre displays xaml gray and no intellisene
Latest update of the Visual studio 2017 pre display xamls totally gray for me and no intellisense. same project's xamls are fine on vs 2017. Is this a know issue?
How to remove the title bar
Hello, I tried to use several commands that I found on the internet to solve this problem, but I could not find a solution. Please help me!!
I just want to remove the title bar. Attached is an image of the bar that I need to remove.
Thank you!