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

Any generic steps to upgrade from older Crashlytics to 'Xamarin.Firebase.Crashlytics'..?

$
0
0

Hi,

I'm trying to update(replace) my older crashlytics to the recent plugins ie. Xamarin.Firebase.Crashlytics to my Xamarin forms project. But i end up getting one or the other compile time errors.
For Eg:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Legacy.targets(5,5): Error XALNK7000: Java.Interop.Tools.Diagnostics.XamarinAndroidException

I referred to: https://github.com/a-imai/XamarinCrashlyticsUpgradeSample (The author genuinely says, its not an official procedure or a perfect procedure)

I'm on latest version of xamarin forms and Visual Studio for Mac.

Looking for some help here.

Regards,
Raghavendra


PushModalAsync to display half page

$
0
0

Hi, I am using PushModalAsync which displays full page. Is there a way to display just the bottom half like what apple does with the new in-app purchase modal page in iOS 11? Or similar with apple pay bottom half modal? Thanks.

This is an example screenshot of what the modal looks like.

Uploading IPA to Apple error message not sure what it all means can anyone shed light, please

$
0
0

Sorry for image but best way to show all issues as apple doesn't not allow you to copy and paste it :( looking on line the first error might be my icon so will look at changing that but as this is going to take a few hours thought I would upload to see if you can spot any other issues, I did upload twice but got ULWebView email from Apple, I believe I have now fixed that issue by using --optimize=experimental-xforms-product-type or even upgrading to Xamarin.forms pre 5 but now get the following error doesn't matter what I do :(

How to change navigationbar back button color?

$
0
0

I searched and find that I have the change the styles.xml in android.

I tried but failed.

please tell me how to change the back button color now?

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?

Help me fix an error Android.Views.InflateException

$
0
0

Hi.

I try to use Fingerprint plugin. In PCL project my MainPage derives from Shell and this is a problem. If the MainPage do not derives from Shell than it's ok and I don't have any error.

I have the following error on Build:

Android.Views.InflateException: 'Binary XML file line #1 in com.companyname.app417:layout/flyoutcontent: Binary XML file line #1 in com.companyname.app417:layout/flyoutcontent: Error inflating class android.support.design.widget.CoordinatorLayout'

I had this kind of error before for ToolBar file in Xamarin.Andoird layout folder. I Fixed it by changing the name from android.support.v7.widget.Toolbar to androidx.appcompat.widget.Toolbar and this solved the issue.
The problem is that I don't have any flyoutcontent file in Xamarin.Android layout folder and cannot rename it.

How can I fix this?

why navigation between pages in xamarin forms is slow on Android

How to solve (The type 'Worker' exists in both...) error?

$
0
0

Hi,

I have updated my Xamarin Forms to latest pre 4.5 and now I am getting:

**Error CS0433 The type 'Worker' exists in both 'Xamarin.Android.Arch.Work.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' and 'Xamarin.AndroidX.Work.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
**

How can I fix this please?

Thanks,
Jassim


how to invoke an activity from a class

$
0
0

how to invoke an activity from a class and get the result xamarin android

xamarin forms collectionView vertical offset binding

$
0
0

How can we bind vertical offsets of two collectionViews together?

i have application xamarin forms with enable multidex but not working at android 19

$
0
0

i have application xamarin forms with enable multidex but not working at android 19 if someone made video or screenshots to me i would be thankful

i tried to solve it with internet

i saw that but really don't how to do it?

is that one at application android?

multidex.keep file in my project root

mono/android/app/ApplicationRegistration.class
mono/android/app/NotifyTimeZoneChanges.class
mono/MonoRuntimeProvider.class
mono/MonoPackageManager.class
mono/MonoPackageManager_Resources.class

then

manually add to .csproj to all build options

 <AndroidEnableMultipleDex>true</AndroidEnableMultipleDex>
 <AndroidEnableMultiDex>true</AndroidEnableMultiDex>

where is it? how can i put it?

3rd step i did

<application android:name="android.support.multidex.MultiDexApplication">.....</application

and after that i don't know how to make it

in MainApplication class in Android folder add Register attribute

[Application]
[Register("android/support/multidex/MultiDexApplication", DoNotGenerateAcw = true)]
public class MainApplication : Application, Application.IActivityLifecycleCallbacks
{ ... }

Add Name to MainActivity

 [Activity(Name = "xx.xxx.MainActivity")]
 public class MainActivity : 
 global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
 { ... }

Master Page with MenuList the icons appear at emulator but not at the real devices??

$
0
0

i have problem at my app it works well at the emulator but at my device not when in export it

i have master page and this is the xml code

<?xml version="1.0" encoding="utf-8" ?>
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:WatchtoWin"
             x:Class="WatchtoWin.Home_Page"
             NavigationPage.HasNavigationBar="False"
             BackgroundColor="#00a2e8">

    <MasterDetailPage.Master>
        <ContentPage Title="Menu"
                     xmlns="http://xamarin.com/schemas/2014/forms" 
                     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
                     xmlns:local="clr-namespace:WatchtoWin"
                 BackgroundColor="#e8e8e8">

            <StackLayout Orientation="Vertical">

                <!-- 
             This StackLayout you can use for other
             data that you want to have in your menu drawer
        -->
                <StackLayout.Children>
                    <Label Text="{Binding Header}" />

                    <Image Source="{Binding Image}" Aspect="AspectFit" />

                    <Label Text="{Binding Footer}" Margin="5" />
                </StackLayout.Children>

                <ListView x:Name="navigationDrawerList"
                  RowHeight="55"
                  SeparatorVisibility="Default"
                  BackgroundColor="#e8e8e8"
                  ItemSelected="OnMenuItemSelected">

                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>

                                <!-- Main design for our menu items -->

            <StackLayout VerticalOptions="FillAndExpand"
                             Orientation="Horizontal"
                             Padding="20,10,0,10"
                             Spacing="20">

                                    <Image Source="{Binding Icon}"
                         WidthRequest="40"
                         HeightRequest="40"
                         VerticalOptions="Start" />

                                    <Label Text="{Binding Title}"
                         FontSize="15"
                         VerticalOptions="Center"
                         TextColor="Black"/>
                                </StackLayout>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>

            </StackLayout>

        </ContentPage>
    </MasterDetailPage.Master>


    <MasterDetailPage.Detail>
        <NavigationPage>

        </NavigationPage>
    </MasterDetailPage.Detail>
</MasterDetailPage> 

and this is the source code

            MenuList = new List<MainPageMasterMasterMenuItem>();

            //this are for android Icons you can download from android asset studio and include in Your Project Resources Folder
            // Creating our pages for menu navigation
            // Here you can define title for item, 
            // icon on the left side, and page that you want to open after selection

            var page1 = new MainPageMasterMasterMenuItem() { Title = "Home", Icon = "home_40px.png", TargetType = typeof(HomePage) };
            var page2 = new MainPageMasterMasterMenuItem() { Title = "How it works?", Icon = "info.png", TargetType = typeof(Welcome_Home) };
            var page3 = new MainPageMasterMasterMenuItem() { Title = "Add Coins", Icon = "Coins.png", TargetType = typeof(Welcome_Home) };
            var page4 = new MainPageMasterMasterMenuItem() { Title = "Withdrawal", Icon = "withdrawal.png", TargetType = typeof(Welcome_Home) };
            var page5 = new MainPageMasterMasterMenuItem() { Title = "Share", Icon = "share.png", TargetType = typeof(Welcome_Home) };
            var page6 = new MainPageMasterMasterMenuItem() { Title = "Rate Us", Icon = "rate.png", TargetType = typeof(Welcome_Home) };
            var page7 = new MainPageMasterMasterMenuItem() { Title = "Logout", Icon = "logout.png", TargetType = typeof(Welcome_Home) };


            MenuList.Add(page1);
            MenuList.Add(page2);
            MenuList.Add(page3);
            MenuList.Add(page4);
            MenuList.Add(page5);
            MenuList.Add(page6);
            MenuList.Add(page7);

            // Setting our list to be ItemSource for ListView in MainPage.xaml
            navigationDrawerList.ItemsSource = MenuList;
            // Initial navigation, this can be used for our home page
            Detail = new NavigationPage((Page)Activator.CreateInstance(typeof(HomePage)));

            this.BindingContext = new
            {
                Header = "",
                Image = "Splash_logo.png",
                //Footer = "         -------- Welcome To HotelPlaza --------           "
                Footer = "Welcome To WatchtoWin: " + fullname
            };


            NavigationPage.SetHasBackButton(this, false);

it should be like that

but what i draw with pen not appear at the real devices??

Forms app hangs when calling .Result on an async request

$
0
0

I have created a cross-platform xamarin forms app (xamarin.forms version 4.5.0.495) and run the android app using Android 10.0 (Q) and a Pixel 2 Q 10.0 - API 29 emulator.

My xaml page contains this block:
<Entry Placeholder="please enter your search query" ClearButtonVisibility="WhileEditing" Keyboard="Text" ReturnType="Search" Completed="OnSearch" > </Entry>

The code in my xaml.cs file looks like this:

`
private async void OnSearch(object sender, EventArgs e)
{
string url = ...;
string result1 = await GetAsync(url);
string result2 = Task.Run(() => GetAsync(url)).Result;
string result3 = GetAsync(url).Result;
}

    private static async Task<string> GetAsync(string url)
    {
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

        using (HttpWebResponse response = (HttpWebResponse)await request.GetResponseAsync())
        using (Stream stream = response.GetResponseStream())
        using (StreamReader reader = new StreamReader(stream))
        {
            return await reader.ReadToEndAsync();
        }
    }

`

I have hard-coded the url for debugging purposes. Moreover I am not yet allowed to post links so I have replaced the url to wikipedia with '...'. When debugging the application result1 and result2 can be obtained, however, the app is stuck thereafter and result3 can not be retrieved.

The stack trace looks as follows:

`

0xFFFFFFFFFFFFFFFF in System.Threading.Monitor.Monitor_wait C#
0x31 in System.Threading.Monitor.ObjWait at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85,5 C#
0x11 in System.Threading.Monitor.Wait at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218,13    C#
0x3 in System.Threading.Monitor.Wait at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:228,13 C#
0x109 in System.Threading.ManualResetEventSlim.Wait at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corert/src/System.Private.CoreLib/shared/System/Threading/ManualResetEventSlim.cs:607,33  C#
0x30 in System.Threading.Tasks.Task.SpinThenBlockingWait at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2892,25 C#
0x6C in System.Threading.Tasks.Task.InternalWait at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2832,21 C#
0x13 in System.Threading.Tasks.Task<string>.GetResultCore at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:490,31   C#
0x11 in System.Threading.Tasks.Task<string>.get_Result at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:466,19  C#

`

It looks like there might be a deadlock.
I have searched the forum for "Monitor_wait" and found this this thread and bug report:

(I am not allowed to post links yet, I hope you can find these references:)

https://forums.xamarin.com/discussion/comment/189927#Comment_189927
and
github => bugzilla-archives/40/40228/bug

I guess that my finding is related to the bug above, which has been fixed in xamarin.forms version 2.2.0-pre4. Please bear with me, as I am new to Xamarin, maybe my setup is odd or I am doing something wrong. Any kind of input is appreciated,

best regards!

How to design a RangeSlider ?

$
0
0

I am trying to design a range slider for price .I am not Finding solution. Any suggestion please?

How to implement Vungle Ads in Xamarin.Forms?

$
0
0
  1. How to implement Vungle Ads in Xamarin.Forms?
  2. I have search on Internet few day ago, I still not found a sample about Vungle Ads for Xamarin.Forms?

If you have a sample, could you please share it?

Thank you!


Xamarin Forms MessagingCenter does not receive message

$
0
0

I have downloaded MultiImagePicker from this link https://github.com/danielkon96/MultiImagePickerand it's working fine without any problem . When I add all interfaces and classes and... in my project , the MessagingCenter does not receive message .

ButtonClick in UploadPage

MessagingCenter.Unsubscribe<App, List<string>>((App)Xamarin.Forms.Application.Current, "ImagesSelectedAndroid");
MessagingCenter.Subscribe<App, List<string>>((App)Xamarin.Forms.Application.Current, "ImagesSelectedAndroid", (s, images) =>
{
   if (images.Count > 0)
   {
      ImgCarouselView.ItemsSource = images;
      InfoText.IsVisible = true;
   }
});

OnActivityResult in MainActivity

MessagingCenter.Send<App, List<string>>((App)Xamarin.Forms.Application.Current, "ImagesSelectedAndroid", images);

What's the Problem ?

Using Ninject and Xamarin Forms with Tabbed page, dependency injection bypassed?

$
0
0

Hi all,

Noob/hobbyist here.
I'm currently using Ninject in Xamarin Forms to handle dependency injection, navigation etc.. I'm able to register view mappings, bind models and navigate successfully between pages (sometimes passing in models as parameters).

I added a Tabbed page which has 4 tabs, each to a navigation page. Now when I navigate between tabs to these pages it seems there's no bindings between the page and view models that I registered in Ninject because I'm not navigating using Ninject, the Tabbed page bypassed this.

Is there a way to overcome this? I've found some mention of custom renders although I'm not too familiar with how you would implement this for each platform or if it's even possible.
I'm looking into the TabbedPage_CurrentPageChanged event but I'm not sure if this would get really sloppy and lead me down another rabbit hole. Is there a way to override the Tabbed page navigation ?

Has anyone had a similar problem and know of the right path to go down?

Thanks in advance
Shaun

Note : Question has also been asked in the Microsoft Q&A forums

I need Master Detail Page and Tabbed Page(bottom) at the same time in the application

$
0
0
When we set drawer screen layout as master and Tabbed Page as detail we can achieve this. But the problem is when i try to click on the menus in the drawer screen of master detail page, i loss the tabbed page navigation from bottom.

Masterdetail Navigation Help

$
0
0

After a failed attempt to use shell, I have decided to go with MasterDetail page.

I am not sure if this is set up correct as I am getting null exceptions when page navigation from the masterdetail -"detail" element.

Set is my flow,

  1. App.CS = MainPage = new LoadingView(); loadingview checks if users token is still valid,

if (valid)
2. => Application.Current.MainPage = new FlyoutMenuView(); (THIS IS MY MASTERDETAIL)
else
Application.Current.MainPage = new LoginView();
THEN => Application.Current.MainPage = new FlyoutMenuView();

  1. MASTERDETAIL
    Detail = new NavigationPage(new DashboardView()); (Setting the default page in the masterdetail.)

Then I have some simply text buttons to 2x other features for example
private void Folders_OnTapped(object sender, EventArgs e)
{
Detail = new NavigationPage(new FolderSelectorView());
IsPresented = false;
//isPresent will hide the menu
}

My issue is, on these feature pages, "FolderSelectorView" , I have buttons to goto content pages relating to that feature, for example create folder page etc,

I am having to do this:
MasterDetailPage masterDetail = (MasterDetailPage)Application.Current.MainPage; await masterDetail.Detail.Navigation.PushAsync(new CreateFoldersView());

Have I done something worng?

Animating scrollview items appear & disappear.

$
0
0

I'm trying to create some animations inside a CollectionView. This is when the items are added or when the items are removed.
I have looked for some animations tutorials however I have not seen an example being applied to the items inside the collectionview, how could I animate them?

Thanks!

Viewing all 76418 articles
Browse latest View live


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