In IOS simulator after I clicked the SearchBar the APP stucked,why?
I can not click anywhere
it works well in the physical phone
In IOS simulator after I clicked the SearchBar the APP stucked,why?
I can not click anywhere
it works well in the physical phone
Hey there.
I made a custom AppIcon and SplashScreen. On Simulator - it's working fine. I see correct AppIcon and SplashScreen.
When I connect an iPhone to my machine, and debug to that local device, then it's using stock Xamarin app icon and splash screen.
If I remote debug to same iPhone over network, It shows correct app icon and no splash screen.
Hi everyone!
After Google announced new restrictions for Android Q making folder writable XOR executable, I am a bit confused where to put executable files from my example and how to properly use them. Maybe I am almost there but maybe I am miles away on completely wrong path...
This is fully working example when I run in Debug mode. I initialize Process feeding it with 3rd party executable 'stockfish.so'.
ProcessStartInfo psi = new ProcessStartInfo(); string engineUsed = "stockfish.so"; psi.FileName = Path.Combine(context.ApplicationInfo.NativeLibraryDir, engineUsed); psi.UseShellExecute = false; psi.CreateNoWindow = true; psi.RedirectStandardInput = true; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true; stockfishProcess = new System.Diagnostics.Process(); stockfishProcess.OutputDataReceived += OnDataReceived; stockfishProcess.StartInfo = psi; stockfishProcess.Start(); stockfishProcess.PriorityClass = ProcessPriorityClass.Idle; stockfishProcess.BeginErrorReadLine(); stockfishProcess.BeginOutputReadLine(); initialized = true;
These executables communicate purely using input and output text messages as described bellow. There are no calls to functions of this 3rd party executable. This is standard used in chess engines for last 20 years and I have no control over those *.so files. I must take them as they are with all their communicating logic.
public void SendLine(string command) { stockfishProcess.StandardInput.WriteLine(command); stockfishProcess.StandardInput.Flush(); } private void OnDataReceived(object sender, DataReceivedEventArgs e) { if (e.Data == null) return; lb.OnStockfishDataUpdate(e.Data); }
My question is very simple: What is the way to keep my app functionality once I start targeting Android Q? Before the restriction I used two Raw resources for v7a and v8a ABIs, loading better one to app directory and then execute it as above.
As I mentioned, this example works for me in Debug mode and I presume it would be fine on Android Q too as the jniLibs is read-only. In Release mode the 'stockfish.so' file however doesn't exist.
I was playing with android.bundle.enableUncompressedNativeLibs
and android:extractNativeLibs in application tag of AndroidManifest,
but it didn't lead me anywhere.
I read ton of text regarding app bundles regarding similar issues, but isn't it possible to make this task easier?
The list shows correct # of items but the items are empty however the details page shows the correct content. The xaml and code behind for both
are attached. this code is vs2019 pro based in mobile app with shared lib and and android, ios, uwp and web projects.
Hi Everyone,
I am trying to change the Font-Family of the Toolbar. I have tried the following without any luck, could someone please point me in the right direction.
The Toolbar.xml came as default on the project in the .DroidProject/resources/layout folder along with Tabbar.xml
Attempt #1 - Set android:fontFamily via app:titleTextAppearance
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="?attr/colorPrimary" android:layout_height="wrap_content" android:layout_width="match_parent" app:titleTextAppearance="@style/ActionBarTitleStyle"/>
<style name="ActionBarTitleStyle" parent="android:Widget.TextView"> <!-- The action bar title font --> <item name="android:fontFamily">Montserrat-Medium</item> <!-- Customizes the color of the action bar title--> <item name="android:textColor">#ffffff</item> <!-- Customizes the size of the action bar title--> <item name="android:textSize">19sp</item> </style>
Attempt #2 - Directly adding an entry for android:fontFamily="Montserrat-Medium"
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="?attr/colorPrimary" android:layout_height="wrap_content" android:layout_width="match_parent" android:fontFamily="Montserrat-Medium" app:titleTextAppearance="@style/ActionBarTitleStyle"/>
Attempt #3 (Build Failed)- Trying to target the Property FontFamily on a TargetType as NavigationPage with the Value set to Montserrat-Medium
//AssemblyInfo.cs using Xamarin.Forms; using Xamarin.Forms.Xaml; [assembly: XamlCompilation(XamlCompilationOptions.Compile)] [assembly: ExportFont("Montserrat-Medium.ttf", Alias = "Montserrat-Medium")]
<Application.Resources> <x:StyleSheetExtension Source="GlobalStyles.css" /> <Style TargetType="Button"> <Setter Property="CornerRadius" Value="18" /> <Setter Property="FontFamily" Value="Montserrat-Medium" /> <!-- THIS WORKS for a Button--> </Style> <Style TargetType="NavigationPage"> <Setter Property="FontFamily" Value="Montserrat-Medium" /> </Style> </Application.Resources>
Hi. My app is crashing.... so I put some debug statements (AI - .....) in the code to see why and it seems to be related to SkiaSharp:
05-24 10:06:11.408 I/mono-stdout(30859): AI - Keep Max - End 05-24 10:06:11.408 I/mono-stdout(30859): AI - Keep Max 05-24 10:06:11.408 I/mono-stdout(30859): AI - Keep Max - End 05-24 10:06:11.408 I/mono-stdout(30859): AI -Play Scandal On Player 05-24 10:06:11.436 V/MediaPlayer(30859): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false 05-24 10:06:11.436 V/MediaPlayer(30859): cleanDrmObj: mDrmObj=null mDrmSessionId=null 05-24 10:06:11.615 D/Mono (30859): Requesting loading reference 3 (of 10) of /storage/emulated/0/Android/data/com.companyname.potocracy/files/.__override__/Potocracy.dll 05-24 10:06:11.615 D/Mono (30859): Loading reference 3 of /storage/emulated/0/Android/data/com.companyname.potocracy/files/.__override__/Potocracy.dll asmctx DEFAULT, looking for SkiaSharp, Version=1.68.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756 05-24 10:06:11.615 D/Mono (30859): Assembly Ref addref Potocracy[0xe31ffb20] -> SkiaSharp[0xe31ffd00]: 2 **System.NullReferenceException:** 'Object reference not set to an instance of an object.' 05-24 10:06:22.803 E/mono (30859): Full thread dump: "Debugger agent" "Thread Pool Worker" "Thread Pool Worker" "Finalizer" "<unnamed thread>" at <unknown> <0xffffffff> at (wrapper managed-to-native) System.Diagnostics.Debugger.Mono_UnhandledException_internal (System.Exception) <0x00012> at System.Diagnostics.Debugger.Mono_UnhandledException (System.Exception) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-10/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:120 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.42 (intptr,intptr) [0x00020] in <4ccdb3137d974856b786e1aeebbfbab6>:0 at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.42 (intptr,intptr) [0x00030] in <4ccdb3137d974856b786e1aeebbfbab6>:0 "Timer-Scheduler" "<threadpool thread>" "Thread Pool Worker" 05-24 10:06:32.851 I/libc (30859): Requested dump for tid 30859 (yname.potocracy)
However, my App only uses SkiaSharp on one page. That page has always worked when I called it... and in my testing I am not calling it.
The code running at the time of the crash is not even remotely related to SkiaSharp. I use SkiaSharp to create a gameboard map and it is only called when the user clicks a button. I'm not clicking that button.
Any ideas?
Thank you.
I have been struggling to add AdMob to an iOS application that I've built using Xamarin Forms. AdMob was the last detail that I needed to publish my app, but every time I add any of the following Nuget packages my app won't compile. I've checked all of the listed dependencies and they are installed. I have been forced to re-write my app in Xcode in order to get it published. I am writing this as a plea for someone at Xamarin to resolve this issue. It's too late for me, but I'm certain that others will have this issue and re-writing in Xcode was a desperate move for me.
Xamarin.Google.iOS.MobileAds
Xamarin.Firebase.iOS.Core
Xamarin.Google.iOS.SignIn
Hallo,
maybe somebody can help help. Android is just not updating the control or not binding in the first place. Using UWP & IOS everthing works fine. I was using different Kind of conecpts, Always IOS & UWP is working as expected, Android dont't. I use the Emulator or a device attached
I tried even with a very simple Code, no error, Android is just not showing the Elements in the picker control
<Picker ItemsSource="{Binding GetTracks}" ItemDisplayBinding="{Binding TrackName}"/>
` public class GetTracks
{
private int trackID;
public int TrackID
{
get { return trackID; }
set { trackID = value; }
}
private string trackName;
public string TrackName
{
get { return trackName; }
set { trackName = value; }
}
}
public class AnalyseViewModels { private ObservableCollection<GetTracks> getTracks; public ObservableCollection<GetTracks> GetTracks { get { return getTracks; } set { getTracks = value; } } public AnalyseViewModels() { getTracks = new ObservableCollection<GetTracks>(); getTracks.Add(new GetTracks() { TrackID = 1, TrackName = "TEST1" }); getTracks.Add(new GetTracks() { TrackID = 2, TrackName = "TEST2" }); getTracks.Add(new GetTracks() { TrackID = 3, TrackName = "TEST3" }); getTracks.Add(new GetTracks() { TrackID = 4, TrackName = "TEST4" }); getTracks.Add(new GetTracks() { TrackID = 5, TrackName = "TEST5" }); }`
Thanks for an advice
Markus
Hi
I Have xamarin forms application, authenticate with asp.net membership and give accesstoken after authenticate.
In other platforms (ex silverlight, javascrip libs ....), this token access shared accross all requests to server (ex webclient,httpclient, image source request and ...) and all requests send it to server automaticaly
how can I share this token on xamarin forms for all requests?
I cant set cookies for all requests handly. because some of them like imagesource does not have any way to set it
I believe it must be the most common requirement during development that one will need to make frequent changes to database and models etc. What I am looking for is that how I can use a local instance of a database on my desktop and not from emulator. I mean do I really have to copy time and again. I thought we will have a straight forward technique where the database will reside on my desktop. I will develop against this database and once done I will use adb shell to copy it to emulator and finally deploy it.
I'm going crazy for hours on an evil problem!!!
I've created a new Xamain Forms prj on Visual Studio for Mac (last version and last update).
I have three AppResources files for corrispondent languages: - AppResources.resx (for default) - AppResources.it.resx (for italian) - AppResources.es.resx (for spanish)
On IOS simulator, works all good. On Android I see always the default string.
This is my simple data on AppResources file:
AppResources.resx:
Default
AppResources.es.resx:
Espanol
AppResources.it.resx:
Italiano
Why on IOS works perfectly and on Android I can see only "default"?!?
When I run my app I see many log entries similar to the following. Are these anything I should be concerned about? Is there anything I can do to stop them?
[monodroid-assembly] typemap: unable to find mapping to a Java type from managed type 'System.Int32, mscorlib' [monodroid-assembly] typemap: unable to find mapping to a managed type from Java type 'androidx/fragment/app/BackStackRecord' [monodroid-assembly] typemap: unable to find mapping to a managed type from Java type 'androidx/fragment/app/BackStackRecord' [monodroid-assembly] typemap: unable to find mapping to a managed type from Java type 'com/android/internal/policy/PhoneLayoutInflater' [monodroid-assembly] typemap: unable to find mapping to a managed type from Java type 'androidx/fragment/app/FragmentManagerImpl' [monodroid-assembly] typemap: unable to find mapping to a Java type from managed type 'System.Int32, mscorlib'
https://www.github.com/ssombat/xamarinUWPMemory
I created a small sample project. I post the 2 main files to GitHub.
The project just added 200 "OuterFames" (A frame within a frame that has a button) in a flex layout.
And we clear the flexlayout's children. This runs in a loop with some sleeps in-between.
Basically adding and removing those gui objects to the screen.
In theory, memory shouldn't keep growing but it does.
After 5 mins of running, the memory usage is over double than it should be.
I also tested by implementing IDisposable but no changes.
Is there something I'm doing wrong?
Memory leak in the framework?
Hi! I'm trying to use Firebase Smart Reply in my Xamarin.Android project. I followed the Firebase guide and set it up in my Xamarin project. However, it is not working. I'm using Visual Studio 2019 16.6.0.
I added the following Nuget packages for Firebase Smart Reply:<PackageReference Include="Xamarin.Firebase.ML.Natural.Language"> <Version>122.0.0-preview02</Version> </PackageReference> <PackageReference Include="Xamarin.Firebase.ML.Natural.Language.Id.Model"> <Version>120.0.7-preview02</Version> </PackageReference> <PackageReference Include="Xamarin.Firebase.ML.Natural.Language.Model"> <Version>120.0.7-preview02</Version> </PackageReference> <PackageReference Include="Xamarin.Firebase.ML.Natural.Language.Smart.Reply"> <Version>118.0.7-preview02</Version> </PackageReference> <PackageReference Include="Xamarin.Firebase.ML.Natural.Language.Smart.Reply.Model"> <Version>120.0.7-preview02</Version> </PackageReference> <PackageReference Include="Xamarin.Firebase.ML.Natural.Language.Translate"> <Version>122.0.0-preview02</Version> </PackageReference>
Also added the following in my Android Options to disable compression of Smart Reply model file:<AndroidStoreUncompressedFileExtensions>.tflite;tflite</AndroidStoreUncompressedFileExtensions>
However, on running, Smart Reply throws this exception every time the code calls SuggestReplies() function:com.google.firebase.ml.common.FirebaseMLException: Failed to generate smart reply
The console log shows these lines when the exception is thrown:
I/mono-stdout( 6829): Log: SmartReply Test 5 - Conversation
W/monodroid-assembly( 6829): typemap: unable to find mapping to a managed type from Java type 'com/google/android/gms/tasks/zzu'
I/mono-stdout( 6829): Log: 2nd call
I/mono-stdout( 6829): Log: Start Time: 5/23/2020 7:11:27 PM
W/monodroid-assembly( 6829): typemap: unable to find mapping to a managed type from Java type 'com/google/android/gms/tasks/zzu'
W/monodroid-assembly( 6829): typemap: unable to find mapping to a Java type from managed type 'System.Int32, mscorlib'
W/monodroid-assembly( 6829): typemap: unable to find mapping to a Java type from managed type 'System.Int32, mscorlib'
D/Mono ( 6829): DllImport searching in: '__Internal' ('(null)').
D/Mono ( 6829): Searching for 'java_interop_jnienv_is_assignable_from'.
D/Mono ( 6829): Probing 'java_interop_jnienv_is_assignable_from'.
D/Mono ( 6829): Found as 'java_interop_jnienv_is_assignable_from'.
I/tflite ( 6829): Initialized TensorFlow Lite runtime.Initialized TensorFlow Lite runtime.
W/monodroid-assembly( 6829): typemap: unable to find mapping to a Java type from managed type 'System.Int32, mscorlib'
E/ModelResourceManager( 6829): Error preloading model resource
E/ModelResourceManager( 6829): com.google.firebase.ml.common.FirebaseMLException: Couldn't open language detection model file
E/ModelResourceManager( 6829): at com.google.firebase.ml.naturallanguage.languageid.internal.LanguageIdentificationJni.zzl(com.google.firebase:firebase-ml-natural-language@@22.0.0:23)
E/ModelResourceManager( 6829): at com.google.firebase.ml.naturallanguage.languageid.FirebaseLanguageIdentification$zzb.zzl(com.google.firebase:firebase-ml-natural-language@@22.0.0:6)
E/ModelResourceManager( 6829): at com.google.android.gms.internal.firebase_ml_naturallanguage.zzde.zzf(com.google.firebase:firebase-ml-natural-language@@22.0.0:53)
E/ModelResourceManager( 6829): at com.google.android.gms.internal.firebase_ml_naturallanguage.zzde$zza.zzdn(com.google.firebase:firebase-ml-natural-language@@22.0.0:7)
E/ModelResourceManager( 6829): at com.google.android.gms.internal.firebase_ml_naturallanguage.zzde$zza.call(com.google.firebase:firebase-ml-natural-language@@22.0.0:24)
E/ModelResourceManager( 6829): at com.google.android.gms.internal.firebase_ml_naturallanguage.zzco.zza(com.google.firebase:firebase-ml-natural-language@@22.0.0:31)
E/ModelResourceManager( 6829): at com.google.android.gms.internal.firebase_ml_naturallanguage.zzcr.run(Unknown Source:4)
E/ModelResourceManager( 6829): at android.os.Handler.handleCallback(Handler.java:873)
E/ModelResourceManager( 6829): at android.os.Handler.dispatchMessage(Handler.java:99)
E/ModelResourceManager( 6829): at com.google.android.gms.internal.firebase_ml_naturallanguage.zzb.dispatchMessage(com.google.firebase:firebase-ml-natural-language-smart-reply@@18.0.7:6)
E/ModelResourceManager( 6829): at android.os.Looper.loop(Looper.java:193)
E/ModelResourceManager( 6829): at android.os.HandlerThread.run(HandlerThread.java:65)
E/ModelResourceManager( 6829): Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
E/ModelResourceManager( 6829): at android.content.res.AssetManager.nativeOpenAssetFd(Native Method)
E/ModelResourceManager( 6829): at android.content.res.AssetManager.openFd(AssetManager.java:768)
E/ModelResourceManager( 6829): at com.google.firebase.ml.naturallanguage.languageid.internal.LanguageIdentificationJni.zzl(com.google.firebase:firebase-ml-natural-language@@22.0.0:11)
E/ModelResourceManager( 6829): ... 11 more
W/monodroid-assembly( 6829): typemap: unable to find mapping to a Java type from managed type 'Android.Text.IInputFilter, Mono.Android'
W/FirebaseSmartReply( 6829): Failed to identify the language for the conversation
I/chatty ( 6829): uid=10090(com.kapildhaimade.) FirebaseMLHandl identical 3 lines
W/FirebaseSmartReply( 6829): Failed to identify the language for the conversation
V/PredictOnDevice( 6829): input blacklist: "(?i).amber alert.,(?i).http.|.www." context blacklist: "" suggestion blacklist: "(?i)lmao,(?i)you welcome!,(?i)Love you to :),😘,😙,😚,💍,(?i)i'm good and you,(?i).(\b)man\pP($|\s.),(?i).(\b)woman\pP($|\s.),(?i).(\b)men\pP($|\s.),(?i).(\b)women\pP($|\s.),(?i).(\b)boy\pP($|\s.),(?i).(\b)girl\pP($|\s.),(?i).(\b)babe\pP($|\s.),(?i).(\b)baby\pP($|\s.),(?i).(\b)sir\pP($|\s.*)"
I haven't been able to get it running after much troubleshooting. I did try to access the Smart Reply model file 'hobbes.tflite' using Assets.Open() and it seems to work so I'm not sure which file it is unable to find.
Any ideas what I can do to make this work? Thank you for the help
When trying to reproduce this Android toolbar example:
The designer cannot render the include tag and gives the following error:
android.content.res.Resources_Delegate.throwException(Resources_Delegate.java:1145)
android.content.res.Resources_Delegate.throwException(Resources_Delegate.java:1121)
android.content.res.Resources_Delegate.getLayout(Resources_Delegate.java:497)
android.content.res.Resources.getLayout(Resources.java:1155)
android.view.LayoutInflater_Delegate.parseInclude(LayoutInflater_Delegate.java:140)
android.view.LayoutInflater.parseInclude(LayoutInflater.java:900)
android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:859)
android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)
android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
android.view.LayoutInflater.inflate(LayoutInflater.java:515)
android.view.LayoutInflater.inflate(LayoutInflater.java:394)
com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:323)
com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:394)
com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:271)
mono.android.DesignerSession.loadInternal(DesignerSession.java:273)
mono.android.DesignerSession.lambda$load$0(DesignerSession.java:223)
mono.android.MonoDroidBroker.executeInMonoDroidContext(MonoDroidBroker.java:80)
mono.android.DesignerSession.load(DesignerSession.java:223)
mono.android.DesignerSession.processMessage(DesignerSession.java:676)
mono.android.MessageListener.executeMessage(MessageListener.java:88)
mono.android.MessageListener$Runner.run(MessageListener.java:44)
java.lang.Thread.run(Thread.java:748)
This annoying error is already documented all over the internet months ago, without correction in any new versions of Visual Studio/Xamarin!!
Also there is not even a workaround!
Please correct this as soon as possible.
Tx in advance.
Hello, I have an Image wich is located inside a Stacklayout (no height set). I would like to size the image to 100% width of the Stacklayout and the height dynamically.
I've tried all Aspect possibilities and it is not working. With option "AspectFill" the Image is cut off.
Any suggestions?
Thanks.
Dirk
I have a very simple list of 8 objects. They are in an ObservablesList. When I use a datatemplate as a local resource, when the app is loading in Android the "OnTemplateSelected" function is called 4 times for each item in the list... when I reach the 23 resource limit the app crashes.... What this means is that Datatemplates are a non-starter for Android projects.
So, the question is... how do I deal with this issue? I am all for using whatever technique that makes sense... But I have 8 different objects that I believe require no less than 5 different displays depending on the information changes... I have to display between 3 and 12 icons for each object. These are not "static" in nature, so each item could be different with any given application launch. My displays would need to be in multi-lines for mobile... possibly 7 per line... like;
Any suggestions on how to accomplish this would be fantastic!!!
{Image - Name }
{Information label}
X X X
{Image - Name }
{Information label}
X X X X
{Image - Name } {display of more than 7 icons for ease of use}
{Information label}
X X X X X X X
X X X X X
hi is there any way to set the background image to fit the screen size in content pages(xamarin.forms),i think the default settings is set to stretched.
It seems it's possible to some extent to use SVG images in some controls, for instance SVG files can be only added as embedded resources when using some of the available NuGet packages out there. Also, at least for ToolbarItem
the images need to be stored somewhere in the file system, so I had to create my own SVG rasterizer that saves those images to bitmaps in the cache directory, so those could passed in a FileImageSource
to the Icon
property in the control ToolbarItem
. For, the control Button
those images need to be stored in the Resources or drawable directory, so it won't work with the rasterized bitmaps, since those are stored in the cache directory. With all those limitations for trying to use SVG files directly at runtime, I was thinking maybe I could convert all those images to the corresponding JPG or PNG images at build time using some task, but I'm not sure whether that conversion could be done with the current available tools. So, my questions is how to use directly or convert SVG images to use in the common controls in Xamarin.Forms (ToolbarItem
, Button
, etc)?
I have seen only one post so far on Surface Duo in this forum. I hope there is definitely some interest about Surface Duo in the developers.
My issue is about its response for a particular gesture. I am not able to drag the window handle at the bottom of the display to span a Single Pane display to Dual Panes or to close an app. It takes several drags to accomplish this. Whether I use mouse or touch it is same. Otherwise no issue with the emulator.
In the demo at Build 2020, it appeared so easy to span to dual panes or vice versa. But I am not getting that experience. I have tried on a Lenovo AIO and Surface Book (1st edition).
Has anyone else experienced this?