Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 77050 articles
Browse latest View live

When I click cancel button from fingerscan dialog, app is crashed. How can I fix it?

$
0
0

When I click cancel button from fingerscan dialog, following error is occour.
System.AggregateException: 'One or more errors occurred. (Cannot access a disposed object.
Object name: 'Android.OS.CancellationSignal'.)'.

I call fingerscan dialog from onAppearing.


Mandatory sing-in with apple

$
0
0

Sadly, Apple is requiring us to implement "sign in with apple" if we already have sign in with other providers like facebook or google:

Guideline 4.8 - Design - Sign in with Apple

Your app uses a third-party login service, but does not offer Sign in with Apple. Apps that use a third-party login service for account authentication need to offer Sign in with Apple to users as an equivalent option.

Next Steps

Please revise your app to offer Sign in with Apple as an equivalent option for account authentication.

How does everybody handle this? Is there some xamarin/c# sample or tutorial?

Referrer BrodcastReceiver error

$
0
0

Hi friends! I have strange issue in me Xamarin.Forms project. I should connect BrodcastReceiver for referrer link data analysis. I have configured BrodcastReceiver and it works perfectly on most devices, but there are several devices (Meizu Pro 7 or samsung sm j200h for example) where i can't install my app, it shows that apk is broken and can't be installed.

In my research i have made a conclusion, that issue is caused by this two attributes above my BrodcastReceiver class:


[BroadcastReceiver(Exported = true, Permission = "android.permission.INSTALL_PACKAGES", Name = "MeestChinaShop.Droid.Services.ReferrerService")]
[IntentFilter(new[] { "com.android.vending.INSTALL_REFERRER" })]

If i remove those attributes, application would install everywhere, but BrodcastReceiver doesn't work.

Maybe someone faced such problem?

Shell Contents titles are aligned to the left when using Shell

$
0
0

I want to have a "navigation bar" in my Shell where the titles in the bar are evenly spaced. Does anyone have a solution for this?

<Shell xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:views="clr-namespace:SomeApp.Views"
             x:Class="SomeApp.Views.MainPage"
       Shell.NavBarIsVisible="False">
    <TabBar>
        <Tab Title="Exchange">
            <ShellContent Title="Social" ContentTemplate="{DataTemplate views:SocialFeedPage}"/>
            <ShellContent Title="Round Table" ContentTemplate="{DataTemplate views:RoundTablesListPage}" />
            <ShellContent Title="Chat" ContentTemplate="{DataTemplate views:ChatListPage}" />
        </Tab>
        <Tab Title="Meet">
            <ShellContent ContentTemplate="{DataTemplate views:MembersListPage}" />
        </Tab>
        <Tab Title="Connect">
            <ShellContent Title="Events" ContentTemplate="{DataTemplate views:EventsListPage}" />
            <ShellContent Title="Master Classes" ContentTemplate="{DataTemplate views:MasterClassesListPage}" />
        </Tab>
        <Tab Title="Profile">
            <ShellContent ContentTemplate="{DataTemplate views:ProfilePage}" />
        </Tab>
    </TabBar>
</Shell>

Font asset not found Fonts/sans-serif-medium

$
0
0

Idk if it is because of new stable version 4.5.0.530 I updated my project to.
Everything was fine yesterday, now i get error "Font asset not found Fonts/sans-serif-medium" on this line Application.Current.MainPage = new AppShell();

StackTrace:
at Java.Interop.JniEnvironment+StaticMethods.CallStaticObjectMethod (Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0006e] in <26521a5118b44c858c385715922b9d5d>:0
at Java.Interop.JniPeerMembers+JniStaticMethods.InvokeObjectMethod (System.String encodedMember, Java.Interop.JniArgumentValue* parameters) [0x00018] in <26521a5118b44c858c385715922b9d5d>:0
at Android.Graphics.Typeface.CreateFromAsset (Android.Content.Res.AssetManager mgr, System.String path) [0x0004b] in <4ccdb3137d974856b786e1aeebbfbab6>:0
at Xamarin.Forms.Platform.Android.FontExtensions.LoadTypefaceFromAsset (System.String fontfamily) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\FontExtensions.cs:121
--- End of managed Java.Lang.RuntimeException stack trace ---
java.lang.RuntimeException: Font asset not found Fonts/sans-serif-medium
at android.graphics.Typeface.createFromAsset(Typeface.java:839)
at crc643f46942d9dd1fff9.ShellFlyoutRecyclerAdapter.n_onCreateViewHolder(Native Method)
at crc643f46942d9dd1fff9.ShellFlyoutRecyclerAdapter.onCreateViewHolder(ShellFlyoutRecyclerAdapter.java:56)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6794)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5975)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4194)
at android.view.View.layout(View.java:20672)
at android.view.ViewGroup.layout(ViewGroup.java:6194)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:142)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:41)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1556)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:888)
at android.view.View.layout(View.java:20672)
at android.view.ViewGroup.layout(ViewGroup.java:6194)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1255)
at android.view.View.layout(View.java:20672)
at android.view.ViewGroup.layout(ViewGroup.java:6194)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Edit: tried installing different Xamarin.Forms versions, same error.

Xamarin.Forms app not apply code changes from second project assembly without clean/rebuild solution

$
0
0

Hi all.
I use the VS Professional 2019 Version 16.7.7 and latest Xamarin.Forms. Work only with Android part on Windows 10. I have the simple blank app with one MainPage and one MainViewModel, where the viewmodels part implemented as separate assembly. In the ctor of viewmodel I initializes test string, which show on UI via Binding. And the issue in the next: when I start application first - everything is okey, but if I change some code in the ViewModels assembly (for example - change test string value) and relaunch - application not apply these changes without clean/rebuild solution. And even breakpoint show the old property value.


I leave the GD link for my solution, if someone want to try to reproduce issue https://drive.google.com/file/d/1507isz5lX_U6204y5o0_maq7ehBeHKFq

Waiting for helps. Thanks.

Picker corner radius

$
0
0

How to set a corner radius to a picker in xamarin forms ?

MTOUCH : error MT1303: Could not decompress the native framework

$
0
0

Hello,

After update in working solution Xamarin.Firebase.iOS.Core from 6.6.6 to 6.10.4 I can't build iOS projects anymore (downgrading to 6.6.6 fixes the problem). Locally and in Microsoft App Center (debug and release) I can see errors. Same problem appears in 2 different solutions but in 3rd I check everything seems to be fine.

LOCALLY:

start of central directory not found; | FingerReactionTestB.iOS | C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets | 885 |

Could not decompress the native framework 'FBLPromises.framework' from '/Users/Radek/Library/Caches/Xamarin/mtbs/builds/FingerReactionTestB.iOS/e9352cae321e5b371b3db15809ebd8f4/obj/iPhoneSimulator/Debug/mtouch-cache/FBLPromises.framework.zip'. Please review the build log for more information from the native 'unzip' command. | FingerReactionTestB.iOS | C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets | 885 |

APP CENTER:

_CompileToNative:
2020-11-09T12:25:30.6203030Z /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/obj/iPhone/Release/response-file.rsp --optimize=experimental-xforms-product-type "--gcc_flags=-ObjC -lc++ -lsqlite3 -lz -ObjC -lz -lsqlite3 -ObjC -lc++ -lsqlite3 -lz"
2020-11-09T12:25:31.4484760Z Xamarin.iOS 14.0.0.0 (xcode12): 7ec3751a1 using framework: /Applications/Xcode_12.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.1.sdk
2020-11-09T12:25:37.3224190Z Process exited with code 3, command:
2020-11-09T12:25:37.3226300Z /usr/bin/unzip System.String[]
2020-11-09T12:25:37.3294910Z MTOUCH : error [/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/obj/iPhone/Release/mtouch-cache/FBLPromises.framework.zip]: start of central directory not found; [/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/TipCalculator.iOS.csproj]
2020-11-09T12:25:37.3296540Z zipfile corrupt.
2020-11-09T12:25:37.3296900Z (please check that you have transferred or created the zipfile in the
2020-11-09T12:25:37.3297460Z appropriate BINARY mode and that you have compiled UnZip properly)
2020-11-09T12:25:37.3299010Z Archive: /Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/obj/iPhone/Release/mtouch-cache/FBLPromises.framework.zip
2020-11-09T12:25:37.3299390Z
2020-11-09T12:25:40.2261310Z MTOUCH : error MT1303: Could not decompress the native framework 'FBLPromises.framework' from '/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/obj/iPhone/Release/mtouch-cache/FBLPromises.framework.zip'. Please review the build log for more information from the native 'unzip' command. [/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/TipCalculator.iOS.csproj]
2020-11-09T12:25:40.2263420Z
2020-11-09T12:25:40.4956100Z Done Building Project "/Users/runner/work/1/s/TipCalculator/TipCalculator.iOS/TipCalculator.iOS.csproj" (Rebuild target(s)) -- FAILED.
2020-11-09T12:25:40.5382030Z
2020-11-09T12:25:40.5385460Z Build FAILED.

When I checked problematic file (FBLPromises.framework.zip) in mtouch-cache folder it seems to be corrupted in both problematic solutions. Same file in solution without problem seems to be correct.

Cleaning and rebuilding solution didn't help.

Maybe anyone has an idea how to fix this error it?


how to custom xamarin.forms shell titleview in android?

$
0
0

Can it be true that custom the title view in android in xamarin.forms shell?

not specify the titleview in each page but write once every page's title changed?

Plugin.SegmentedControl not changing background color on UWP app

$
0
0

I am using Plugin.SegmentedControl in an iOS/Android/UWP app. While the app is running, I need to change the colors of the segmented control. Here is the code:

    if (Utility.NightVision)
    {
        segmentedControl.TintColor = new Color(0.8, 0.0, 0.0, 0.75);
    }
    else
    {
        segmentedControl.TintColor = new Color(0.8, 0.8, 0.5, 0.75);
    }

    segmentedControl.BackgroundColor = segmentedControl.TintColor;

This doesn't work on Windows. It appears the BackgroundColor isn't updated. If I quit the app and restart it with the new colors, then they are used. So it seems to only be a problem changing BackGroundColor in a running app on UWP.

Any thoughts on how to fix this? I've tried several hacks like disabling and re-enabling the control, but nothing gets the new background color to be used.

Xamarin Forms startup times are unusably slow

$
0
0

My startup screen shows two buttons and a label in a StackLayout, and does nothing more. I've timed the app to take 2.5~3.0 seconds just to show that screen, in Release mode, on an actual device (Motorola Mini XT1030). That's an absurd and unacceptable amount of time to show nothing to the user. As far as I can tell, there's no way to show a splash-screen during that initial loading.

Yes, I'm using [assembly: XamlCompilation(XamlCompilationOptions.Compile)] (without it startup times are around 4.2s!). Running Xamarin Profiler, I see that 100% of the startup code is out of my control.

Is there anything else I can do to speed up my startup times? Or is Xamarin Forms really still not production-ready, and I should start recreating all my UIs on every platform?

How to retrieve and manage Facebook feed/posts and events easily?

$
0
0

I'm working on a basic Xamarin.Forms app for a client, which will contain some tabs like :

  • a company presentation tab (address, phone number, mail, ...)
  • a news tab, with data coming from a dedicated API, or posts from the company's Facebook page
  • a tab allowing to schedule an appointment
  • an "about" page tab

For the news tab, I would like to display informations coming from a dedicated service, or from my client's Facebook page. In both cases, I would like to display a "date", an "image" and a "description". If the data come from Facebook, I would like to display too the "URL" to redirect to the corresponding post.

To recover the Facebook feed of my client's page, I've created a new app on "developers.facebook.com", and I can recover the expected informations ("created_time", "message", "id", "picture") through the API Graph Helper, with calls to "client_page/feed" or "client_page/posts".

For the moment, I'm able to recover the data in my app with an URL like:
https://graph.facebook.com/v8.0/client_page/posts?fields=message,message_tags,picture,full_picture,permalink_url,created_time,story&amp;access_token=ACCESS_TOKEN

But I have remarked that returned post that are events have not "message" or "picture" fields.
I can recover them by calling "client_page/events", which return some other informations like "id", "start_time" or "description".

  • I can't find a relation between the results of these 2 calls ("client_page/posts" and "client_page/events"): the returned id are not corresponding. Is there a way to find a relation between a "post" and an "event"?

  • Is there another way to recover these information, like an existing package that I could import in my project directly?

  • And finally, I haven't yet found a way to generate a "permanent" token to make these calls: must this be done on my client's page side or on the Facebook app side?

Crash in App Store Connect review but not with TestFlight

$
0
0

I have made a "Archive for Publishing" for iOS. It works on the two iPhone devices from TestFlight. But it crashes on startup in review on other iPhones - what could be the issue?

Button on Android all caps

$
0
0

I have just noticed that on Xamarin Forms Android, the text label on elements appears in ALL CAPS. Is this by design?

Regards,
Ian

Remove margin in ProgressBar

$
0
0

Can the margin in the ProgressBar bar be removed and put it touching the NavigationBar?
I have it in a stacklayout with padding and spacing in 0.
image


Toolbars Android and iOS are not the same

$
0
0

Hey!

I have a text and an image in my toolbar, cross-platform. Somehow it looks very good on Android, but not on iOS and I cannot seem to be able to fix this.

Code:

Android:

iOS:

How can I make sure that the toolbar for iOS looks exactly the same for Android?

Hope someone can help.

Xamarin.forms Get the token after logging in

$
0
0

Sorry for my poor language. I would like to know how to get the token after logging in in xamarin.forms. I enter my email and password in postman, it generates the token visible at the bottom

I authorize myself by entering Bearer + token

ZXing Flashlight Not activating

$
0
0

Hello all,

I'm using zxing to scan barcodes in a dark area, I have been fiddling with the flash button built in to zxing, but have yet to get it to actually turn on the light.

I'm sure I'm doing something wrong.

I've already looked at the sample projects that is on github, but still no luck. Do you have a working version? If so, could you explain how it works?
I have it displaying by doing this in the code behind:

        public frmBarcodeReader(modDatabaseUtilities mod)
        {
            InitializeComponent();
            vm = new vmBarcodeReader(mod);
            BindingContext = vm;

            var overlay = new ZXingDefaultOverlay
            {
                ShowFlashButton = true
            };

            overlay.BindingContext = overlay;

            overlay.FlashButtonClicked += (s, ed) =>
            {
                scanner.ToggleTorch();
            };

        }

Also, I'm only using Android if that matters. I believe I have the right permissions set up:

AndroidManifest.xml

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />

and in the Android AssemblyInfo.cs

[assembly: UsesPermission(Android.Manifest.Permission.Flashlight)]
[assembly: UsesPermission(Android.Manifest.Permission.Camera)]

Thank you!

Animate ContentView from bottom to top

$
0
0

I have a ContentView and I have a button on my page. When i click the button i want the content view below to slide in top to bottom. Then i have another button and when that is clicked i want it to slide bottom to top away. Essentially i want to animate the process of changing visibility? can any one help on this task?

Thanks in Advance

How to get XamarinCommunityToolkit running ?

$
0
0

I am still learning and some things are still mysterious to me.
I download the XamarinCommunityToolkit from Github and cloned the repository on my machine. I have the latest version of VS2019 (16.8.0) installed.
But it is not possible for me to get it going. Everything is broke, even the Tizen-Project is not able to load at all.
Am I doing something wrong here ? I expected those official things to run smoothly out of the box !?
I already installed NET Framework 4.7.1 Developer Pack, but it did not help.

I guess that the error sits in front of the computer, but I do not know what to do !?

Viewing all 77050 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>