After I updated VS Community 2019 to 16.3.7 (from 16.2?), the HttpClient.Timeout value is now ignored when calling HttpClient.GetStreamAsync() in my Android app. It seems that the timeout is 130 seconds no matter what timeout is specified. In researching this bug, it seems that this would be an issue in the Mono library. Is there a way to downgrade the Mono library to the previous version that was working? Unfortunately, I don't know exactly what version that was but I do have a working apk built from before that I might be able to use to get the version? Thanks.
HttpClient timeout ignored after VS update. Is there a way to downgrade?
Xamarin Android Debug - How to turn off
Instructions to turn Debug off to create a APK file.
Add this code in AssemblyInfo.cs
if DEBUG
[assembly: Application(Debuggable = true)]
else
[assembly: Application(Debuggable=false)]
endif
But when I upload the APK file I get error
Cannot run iOS app on a device
My project runs fine on the Apple Simulator, but when I attach my iPod Touch (iOS 9), I get errors. I have been trying to get past errors in a rather haphazard way and have gotten past quite a few, but I don't see anything helpful when I do a Google search on the various output items that look like they may be a problem. Also, I have not tried to make a simple iOS app and tried to run it on my iPod.
Here's the build error I get:
Could not link assemblies. Reason: Error while processing references of 'TestXamarinFormsProject.iOS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' RodneyPix.iOS
There are also a few warnings:
Warning The app icon set "AppIcon" has 13 unassigned children. RodneyPix.iOS
Warning The app icon set "AppIcons" has 32 unassigned children. RodneyPix.iOS
Warning Cannot find the assembly 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' referenced from '/Users/andrewwerber/Library/Caches/Xamarin/mtbs/builds/RodneyPix.iOS/da20d03a7a413827de12ab67546223a2/bin/iPhone/Debug/Mono.Android.dll'. RodneyPix.iOS
Warning The app icon set "AppIcons" has 32 unassigned children. RodneyPix.iOS
I saved output from the various Output windows, but I don't want to post all that stuff here since there's so much of it and may not be useful. I also do not want to display anything that might pose a security problem.
Lastly, I do development using Visual Studio 2019 Community Edition for Windows, and have a Mac mini with Catalina and XCode 11.3 on it.
Any clue on how to proceed or analyze the problem would be greatly appreciated.
Receive message Shared mono runtime is endabled for Firstpage
When I attempted to archive I get message THE ARCHIVE PROCESS HAS FAILED - SHARED MONO RUNTIME IS ENABLE FRO FIRSTPAGE.
Where is my binding context ?
I have a basic Xamarin Forms App... Started with Empty template VS 2019. Created a "Start.xaml / Start.cs" Start Page. Added a StartViewModel.cs. All very basic and generic... I added and ObservableCollection DisplayItems... This is a very generic list of configuration elements and just displays them in a very pretty little list... Everything works great...
After some rework of the "Model" (the DisplayItem Class)... I began pulling information for the model from a web service to enhance the information in the model... Again... very simple, and now, what began as a static list of 5 or 6 properties in my class, has grown to 13 properties where a majority of the information is pulled from the internet at regular intervals... Again, everything works perfectly... The one thing I needed to do is ensure that the information was saved locally... I considered using SQLite, but that is far more robust than i required for this proof of concept app. I decided to save it to a JSON file locally... So, I added Newtonsoft, and saved the data, again with some minor modifications to the DisplayItems class. The way this was handled was in the OnSleep method inside of App.cs, where the oncreate looks like the code below.
Again, everything works as expected. The file is saved locally, and the app uses the local copy when started, which makes the app very responsive... with the MVVM architecture the app updates the items in my view as the data is updated asynchronously... very slick and effective...
My next step was to build a details page for the finite detail that was captured from the web. I added a details page to the Views, added a ViewModel for the detail, passed the displayitem object into the constructor of the details page and then changed the App.cs constructor code from; MainPage = new Start(); to => MainPage = new NavigationPage( new Start() );
Now, when the app goes to sleep (or begins shutdown), the data is not saved because MainPage is no longer a standard ContentPage, but a NavigationPage object, and I no longer have access to the BindingContext (the viewmodel of the start page). I have tried several approaches, but nothing seems to save my list to json on sleep... the references to the ObservableList DisplayList in the ViewModel cannot be found because the BindingContext is null for Start Page...
How do I regain access to the Start Page View Model from the context of App? Any help would be appreciated,
public App() { InitializeComponent(); // old code // MainPage = new Start(); MainPage = new NavigationPage( new Start() ); } protected override void OnStart() { } protected override void OnSleep() { FileOperations.SaveDisplayJsonData((MainPage.BindingContext as StartViewModel).DisplayList.ToList()); } protected override void OnResume() { }
Shell - How add programmatically sub menu item in flyout menu.
Hi, how add sub menu item in flyout menu programmatically?
My goal:
-MainMenuElement-01
-------SubMenuElement-01
-------SubMenuElement-02
-------SubMenuElement-03
--------------...
-MainMenuElement-02
-MainMenuElement-03
I can add programmatically MainMenuElement, but I can't add SubMenuElement in MainMenuElement.
I will be grateful for your help.
Sprite2D in a UrhoSharp 3D Scene
Hello,
I need to print flat png inside a sphere (it is a planetarium).
So I can make a square, facing the center, with a png texture but it is quite complicated. Moreover, how will I light all the squares facing the center?
In OpenGL, it is possible to print a png (this is called sprite in openGL).
Is that possible with UrhoSharp? With Particules?
The other solution would be to calculate myself the 2D coordinates of the sphere and print a png with SkiaSharp. But I won't take advantage of the graphic shipset to calculate the 2D projection of the 3D scene (instead with urhosharp I guess)...
What do you think?
Error during release build
Unerwarteter Fehler bei der LinkAssemblies-Aufgabe.
Mono.Linker.MarkException: Error processing method: 'Android.Views.ScaleGestureDetector Xamarin.Forms.Platform.Android.GestureManager::InitializeScaleDetector()' in assembly: 'Xamarin.Forms.Platform.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Support.V4.View.ScaleGestureDetectorCompat::SetQuickScaleEnabled(Android.Views.ScaleGestureDetector,System.Boolean)
bei Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
bei Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
bei Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
bei Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
bei Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
bei Mono.Linker.Steps.MarkStep.ProcessQueue()
--- Ende der internen Ausnahmestapelüberwachung ---
bei Mono.Linker.Steps.MarkStep.ProcessQueue()
bei Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
bei Mono.Linker.Steps.MarkStep.Process()
bei MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
bei Mono.Linker.Pipeline.Process(LinkContext context)
bei MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
bei Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
bei Xamarin.Android.Tasks.LinkAssemblies.Execute()
bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
bei Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() Retailer.Android
Hello,
my code shows this error trying to build a release version.
Can someone explain me what
s happend?
How can I display an image in a list?
I want to put a binded image and in my viewmodel pass the image to ImageSource.
This my Code.
Code XAML
Code ViewModel
And this my result
I get blank
SQLite.SQLiteException: database disk image is malformed in xamarin.forms application
I have created a xamarin.forms application and ship a sqlite database with the application, im getting the following error:
database disk image is malformed.
This is the stacktrace:
SQLite3.Prepare2 (SQLitePCL.sqlite3 db, System.String query) SQLiteCommand.Prepare () SQLiteCommand+<ExecuteDeferredQuery>d__12`1[T].MoveNext () List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00062] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) SQLiteCommand.ExecuteQuery[T] () SQLiteConnection.Query[T] (System.String query, System.Object[] args) SQLiteAsyncConnection+<>c__DisplayClass28_0`1[T].<QueryAsync>b__0 () Task`1[TResult].InnerInvoke () Task.Execute () MyApp+<LoadDocFromDB>d__18.MoveNext () VolumeView+<VolumesListView_ItemSelected>d__13.MoveNext () AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) SyncContext+<>c__DisplayClass2_0.<Post>b__0 () Thread+RunnableImplementor.Run () IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) (wrapper dynamic-method) System.Object.17(intptr,intptr)
This seem to happen sometimes, any clue what might be causing this?
Side Menu
Hi guys, I have an application in xamarin ios classic which I have a menu like the one in the following link https://github.com/TheEightBot/Xamarin.SideMenu
the problem is that when I am in a view and I want to go back through gestures, what is enabled for me is the menu that I have on the left side and I cannot go back, how can I disable the gesture so that the menu does not open and if I let me go back to the previous view if someone can help me please.
Detect CollectionView row Item is Appeared?
Hi all,
Im trying to figuire out I can trigger event of row appearing on CollectionView, previously I used ListView.ItemAppearing Event on listview but CollectionView does not have this event unfortunately so I need another way of detecting a row has appeared? I was using the Scrolled Event but it didnt quite achieve what I wanted since when the collectionview first loads data and displays then nothing triggers but only when I actually scroll.
Bassically I have a chat listview and when a row/message appears a http request send to mark the message as seen so I rely on a trigger when row appears not just scroll event.
Ive gottten this working on android butnot on iOS, below on my view (actually an expandableView) i add effect woth event Appeared
for view appearing:
<expandable:ExpandableView ExpandAnimationLength="125" Spacing="0"> <expandable:ExpandableView.Effects> <effects:ViewLifecycleEffect Appeared="viewLifecycleEffect_AppearedAsync" /> </expandable:ExpandableView.Effects> <expandable:ExpandableView.PrimaryView>
The effect in the shared project:
public class ViewLifecycleEffect : RoutingEffect { public const string EffectGroupName = "XFLifecycle"; public const string EffectName = "LifecycleEffect"; public event EventHandler<EventArgs>? Appeared; public event EventHandler<EventArgs>? Disappeared; public ViewLifecycleEffect() : base($"{EffectGroupName}.{EffectName}") { } public void RaiseAppeared(Element element) { Appeared?.Invoke(element, EventArgs.Empty); } public void RaiseDisappeared(Element element) => Disappeared?.Invoke(element, EventArgs.Empty); }
So finally in the iOS project I try to get notified when view is appearing/showing on screen/window but doesnt get called as views appear which should trigger per row as user scrolling:
public class IosLifecycleEffect : PlatformEffect { private const NSKeyValueObservingOptions _observingOptions = NSKeyValueObservingOptions.Initial | NSKeyValueObservingOptions.OldNew | NSKeyValueObservingOptions.Prior; private ViewLifecycleEffect _viewLifecycleEffect; private IDisposable _isLoadedObserverDisposable; protected override void OnAttached() { _viewLifecycleEffect = Element.Effects.OfType<ViewLifecycleEffect>().FirstOrDefault(); UIView nativeView = Control ?? Container; _isLoadedObserverDisposable = nativeView?.AddObserver("superview", _observingOptions, isViewLoadedObserver); CGRect viewBounds = nativeView.Bounds; CGRect windowBounds = UIScreen.MainScreen.Bounds; // Method below works out view in window but needs to be triggered as rows appear in which case wouldnt need to calculate but rather subscribe to some event like the `AddObserver` above if (windowBounds.Contains(nativeView.ConvertRectToView(viewBounds, nativeView.Window))) { _viewLifecycleEffect?.RaiseAppeared(Element); } } protected override void OnDetached() { _viewLifecycleEffect.RaiseDisappeared(Element); _isLoadedObserverDisposable.Dispose(); } private void isViewLoadedObserver(NSObservedChange nsObservedChange) { _viewLifecycleEffect?.RaiseAppeared(Element); } }
Maybe there is a better way then detecting on the View or perhaps on the CollectionView itself?
Xamarin forms ios firebase remote config
Hi!
I cant seem to find any good tutorial on how to setup firebase remote config for xamarin ios and android. Could anyone share how it should be done? Specifically for xamarin forms iOS version.
App freezes on iPad when in split view mode (multi-tasking) and change between pages
I have come across a very strange bug -- not sure if it in my app, Xamarin.Forms, or iOS itself.
My app switches between several pages derived from ContentPage. When I have my app and another app, for example the iOS "Pages" app on my iPad side-by-side (half screen). It seems to be related to whether the other app is in an input field before switching. Anyway, I press a Button in my app to switch to another page, and my page is kinda there, but the dark blue background want is white, plus no interaction (so, appears "frozen"). But, if move the slider to make it a 2/3 split, it immediately works.
When my app starts in 2/3 screen mode, the result is a bit comical -- the first half of my app is OK (the leftmost third of the screen), but other half refuses to allow interaction (and has white background). Weirdest thing -- one of my buttons straddles the break -- the left part works fine, the right does not.
I've not seen this on an iPad that has not updated to 13.x yet. I'm suspcious that this might be the same issue or related to White Screen after navigating to MasterDetailPage on iPAD iOS 13.2 and iOS 13.0 Broke MasterDetailPage on iPads?, so I added tags that might relate. But, here's the thing -- I'm currently using XF 4.3 (4.3.0.991221). The "solution" for the others was to update to 4.3. And, I'm not really using MasterDetailPage, and those issues don't mention SplitScreen.
I'd just like to hear if someone else has seen something like this, or has any quick suggestions before I try to create a simplified example.
Which gesture recognizer to use?
I have a view which consists of small squares -- 7 columns and 7 rows divided up into a grid of squares.
I want the user to be able to swipe a range of squares. So for example their initial touch might start in column 3, row 1 and the downward swipe would end on column 3 row 5. I just need to know the location/range of the swipe so that I can calculate which squares were included.
Is a UISwipeGestureRecognizer the right thing to use? Or would a UIPanGestureRecognizer be better?
Thanks...
how to implement fingerprint scaning in login form.
I am trying to implement fingerprint in xamarin .
` var cancellation = new System.Threading.CancellationToken();
var auth = await CrossFingerprint.Current.AuthenticateAsync("Please place your finger",cancellation); `
in second line, cannot convert from 'string' to 'Plugin.Fingerprint.Abstractions.AuthenticationRequestConfiguration' this error is occuring.
In MainActivity.cs
CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity); in this line error occurs.
CrossFingerprint does not contain definition for SetCurrentActivityResolver.
How can i implement fingerprint scanning .please help
A
A
b
b
b
b
Xamarin Froms TimePicker Failure
Our app has a Timepicker that until now used to work. Now it gives us this error:
Binary XML file line #20: Error inflating class android.widget.TimePicker.
As I said this used to work, but now we need either a solution or an alternative. Please.
Best regards
ManuelR
P.S.: Added a trace from the Application Output.