Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

Example of a ScrollView setup via the storyboard

$
0
0

Hi,

I was wondering if anyone has any small project which contains an example of a scroll view being implemented correctly within the storyboard?

I'm just struggling to set one up via the storyboard it just doesn't work as I expected.

Any help is greatly appreciated thanks!


Why does app.DragAndDrop() not work to drag tiles in an app

$
0
0

I have tiles that list accounts. I want to drag on to the position of the other and have tried the below code but neither seems to work:

AppResult[] fro = app.Query(x => x.Id("reorder_icon").Sibling().Marked(fromAccount));
AppResult[] t = app.Query(x => x.Id("reorder_icon").Sibling().Marked(toAccount));

app.DragCoordinates(fro.FirstOrDefault().Rect.CenterX, fro.FirstOrDefault().Rect.CenterY, t.FirstOrDefault().Rect.CenterX, t.FirstOrDefault().Rect.CenterY);
app.DragAndDrop(x => x.Id("reorder_icon").Sibling().Marked(fromAccount),x => x.Id("reorder_icon").Sibling().Marked(toAccount));

找@微927,0079快速优惠购买滑铁卢大学毕业,证/文,凭毕业,证/成绩单@微927,0079文,凭 它国请详询9200079

ERROR WITH LATEST NUGET v2.5.0.77 "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded

$
0
0

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:

https://bugzilla.xamarin.com/show_bug.cgi?id=60293

How to create simple TabbedPageRenderer for iOS and Android in Xamarin Forms

$
0
0

Need Simple working Tabbedpage Renderer

Timestamp in strings

$
0
0

Dears,

I have a Label inside listview-viewcell, to show time in UI. The date is received as a number like 1510822596449 (Java timestamp). I want to show the date in strings like "n days ago". How can I achieve this?

<StackLayout>
    <ListView>
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                <StackLayout>
                    <Label Text="{Binding createdTime}"/>
                    </StackLayout>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
      </ListView>
</StackLayout>

I try IValueConverter in the following link, but it is not working.
https://stackoverflow.com/questions/32814176/how-to-format-date-and-time-in-xaml-in-xamarin-application

Anybody, please suggest a solution with working code. Thanks in advance.

Getting a warning "this project type requires xamarin.android" on my xamarin studio. cannot work now

$
0
0

I use Xamarin studio 6.3 on my mac. After updating Xamarin studio, i have started to get a warning "this project type requires xamarin.android to be installed". The problem is i am on iOS 10.10.5 and cannot install the visual studio on my mac.
I tried upgrading my mac to iOS 10.11 but it didnt work last time and had to roll back.

What can i do?

Custom 3d models (Very strange behaviour)

$
0
0

Hi,

I'm trying to learn UrhoSharp (hoping I'm not losing my time as the project doesn't seem very active).

Everything is going very well, after few days I can already do a lot of different things bnut I have a problem with custom models.

Every time I try to use a custom model, it will appear without materials/textures or not appear at all (I use Blender + the urho importer for blender)

Usually I download a free model from a site and then I import it with blender (I have checked the option to export & materials/textures) but until now no luck.

Yesterday I've tried to import a very basic model made with paint3d (no texturtes, only a color) and strangely it worked.

But then I tried to import a flower (available for free in Paint3d), and the result was crazy:

If I set the model without the material, I can see the model, of course without texture;

If I set the model with the material, I can see nothing.

If I use a standard model (cube, spere, etc) and apply the texture, I can see it.

So basically it seems that the combination custom model+ texture doesn't work.

What I'm doing wrong?

Thank you very much


This Project Type requires Xamarin.Android to be installed.

$
0
0

Hi all,

This is driving me up the wall, and in addition is delaying a fix to be released on one of my apps.

Updated to 5.1.

When I started Xamarin the pop up came up telling there is an update as usual. No problem, went through the update process and now this.

Won't let me do a thing.

Things I have tried:

  • Uninstalling Xamarin through my control panel and reinstalling - didn't do a thing.
  • Uninstalling Xamarin through my control panel, going through my PC and remove all folders relating to xamarin, including those in Appdata etc. - didn't help
  • Even installed Alpha 5.1.1 to see if it will help - didn't help.

I am pulling my hair out. I have an important fix to release and I can't even do it.

Can someone advise please. I don't really fancy a clean format and reinstall of my PC.

Could not save account to keychain: -34018

$
0
0

I'm using xamarin.auth to store credentials. But when I want to store the credentials I get an error:

Could not save account to keychain: -34018.

I tried as described here: https://github.com/xamarin/Xamarin.Auth/issues/128. But than I get another error. I'm still debuging in the simulator. What am I doing wrong?

Could not load assembly Parse. Perhaps it doesn't exist in the Mono for Android profile?

$
0
0

Hi,

Can someone help me, I encounter this error when compiling my Xamarin.Forms Android project:

Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Parse, Version=1.7.0.0, Culture=neutral, PublicKeyToken=ba48c3a442de616e'. Perhaps it doesn t exist in the Mono for Android profile?
File name : 'Parse.dll'
    à Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
    à Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection 1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
    à Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)   GreTrac.Android

Context:

  • MyApp.csproj => .Net Standard 2.0 project. I use Parse 1.7.0 inside it
  • MyApp.Android.csproj => Xamarin.Forms Android project. The errors occurs when i build this project. Target=Android 8.0
  • VS 2017
  • All packages are up to date

MyApp.Android : package.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Parse" version="1.7.0" targetFramework="monoandroid80" />
  <package id="PCLExt.FileStorage" version="1.3.1.0" targetFramework="monoandroid80" />
  <package id="Plugin.CurrentActivity" version="1.0.1" targetFramework="monoandroid80" />
  <package id="Plugin.Permissions" version="2.1.0" targetFramework="monoandroid80" />
  <package id="sqlite-net-pcl" version="1.4.118" targetFramework="monoandroid80" />
  <package id="SQLitePCLRaw.bundle_green" version="1.1.9" targetFramework="monoandroid80" />
  <package id="SQLitePCLRaw.core" version="1.1.9" targetFramework="monoandroid80" />
  <package id="SQLitePCLRaw.lib.e_sqlite3.android" version="1.1.9" targetFramework="monoandroid80" />
  <package id="SQLitePCLRaw.provider.e_sqlite3.android" version="1.1.9" targetFramework="monoandroid80" />
  <package id="Xam.Plugin.Geolocator" version="4.1.3" targetFramework="monoandroid80" />
  <package id="Xam.Plugin.Media" version="3.0.1" targetFramework="monoandroid80" />
  <package id="Xam.Plugins.Settings" version="3.1.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Arch.Core.Common" version="1.0.0" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Arch.Lifecycle.Common" version="1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Arch.Lifecycle.Runtime" version="1.0.0" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Annotations" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Compat" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Core.UI" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Core.Utils" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Design" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Fragment" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Media.Compat" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Transition" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.v4" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.v7.AppCompat" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.v7.CardView" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.v7.MediaRouter" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.v7.Palette" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.v7.RecyclerView" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Android.Support.Vector.Drawable" version="26.1.0.1" targetFramework="monoandroid80" />
  <package id="Xamarin.Forms" version="2.5.0.91635" targetFramework="monoandroid80" />
</packages>

Also, because i try to use Parse in .NET Standard 2.0 I get this warning

Warning NU1701: Package 'Parse 1.7.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.

And I do not know if Parse-SDK-dotNET is supported in .NET Standard: (See my bug report on GitHub: Parse-SDK-dotNET#274)

Solutions I try without success:

  • Remove and add package Xamarin.Forms
  • Remove and add package Xamarin.Android.Support.v4
  • Remove and add package Parse
  • Close VS2017 / Delete Packages folder / Restart VS / ...
  • Update Java JDK
  • Update Android SDK

Any solutions and ideas are welcome :blush:

NFC

$
0
0

Does anyone has an idea on how to implement NFC in Xamarin Cross-platform(iOS and Android)? I had tried several ways to implement it with no success.
Thanks

Azure search is not working with typeahead functionality.

$
0
0

Hello guys, I have implemented azure search for searching workspaces from database which I have imported in azure. The issue is when I give a request call for searching the results, it has some time delay into it. My requirement is that I need a flawless azure search without hanging user for every work he types in the Entry field.

private async void SearchEntryTextChanged(object sender, TextChangedEventArgs e)
{
var entry = sender as CustomEntry;
string searchedString = entry.Text;
if (searchedString.Length > 2)
{
_workspaceSearchService = new AzureWorkspaceSearchApi();
List workspaceSearchData = new List();
//workspaceSearchData = await _workspaceSearchService.SearchWorkspaceFromAzure(searchedString);
workspaceSearchData = await _workspaceSearchService.ExecSuggest(searchedString);

               viewModel.SearchWorkspaceRecord = workspaceSearchData;
           }

}

For every character that enter after 2 length I am calling azure search. This request needs some time to get completed and hangs the user until it gets search result. I need these request to be done using typeahead phenomenon. Can anyone suggest me a solution to achieve this?

Below is the azure request:-

public async Task<List> ExecSuggest(string q)
{
try
{
// Execute /suggest API call to Azure Search and parse results
//string url = _serviceUri + AzureSuggestUrl + q;
string url = "https://meelosearchbasic.search.windows.net/indexes/indworkspacesearch/docs/suggest?api-version=2016-09- > >01&suggesterName=sgworkspacesearch&$top=5&$filter=TenantId eq '" + App.userTenantId + "'&search=" + q;
_httpClient = new HttpClient();
Uri uri = new Uri(url);
List Suggestions = new List();

           HttpResponseMessage response = AzureSearchHelper.SendSearchRequest(_httpClient, HttpMethod.Get, uri);
           AzureSearchHelper.EnsureSuccessfulSearchResponse(response);

           var obj = JsonConvert.DeserializeObject<SearchResult>(response.Content.ReadAsStringAsync().Result);
           Suggestions = obj.value;

           return Suggestions.Distinct().OrderBy(x => x.SearchText).ToList();
       }
       catch(Exception e)
       {
           return null;
       }
   }

System.Net.Http.HttpClient Timeout seems to be ignored

$
0
0

I am using Xamarin.iOS 6.3.7.164 and facing a very strange behaviour with timing out requests sent with HttpClient():

The following code tries to get a result from an url that does not exist respectively isn't available (simulating a server outage):

private async void Connect()
{
    var httpClient = new System.Net.Http.HttpClient
    {
        BaseAddress = new Uri("http://192.168.179.33/fooapi/"),
        Timeout = TimeSpan.FromSeconds(3)
    };

    Console.WriteLine("Timeout is set to: " + httpClient.Timeout);
    Console.WriteLine("Start: " + DateTime.Now);

    var start = DateTime.Now;

    try
    {
        await httpClient.GetAsync("foo");
    }
    catch (Exception e)
    {
        Console.WriteLine("Error: " + e.Message);
    }

    Console.WriteLine("Finished: " + DateTime.Now);
    Console.WriteLine("Duration: " + (DateTime.Now - start).TotalSeconds);
}

I expected to see a result after 3 seconds, or at least after 15 seconds (http://msdn.microsoft.com/en-us/library/system.net.http.httpclient.timeout.aspx). But what I get is a task running for 75 seconds:

2013-07-12 00:06:21.134 XamariniOSHttpClientConnectionTimeout[50422:c07] Timeout is set to: 00:00:03
2013-07-12 00:06:21.146 XamariniOSHttpClientConnectionTimeout[50422:c07] Start: 12.07.2013 00:06:21
2013-07-12 00:07:36.613 XamariniOSHttpClientConnectionTimeout[50422:c07] Error: Error: ConnectFailure (Connection timed out)
2013-07-12 00:07:36.614 XamariniOSHttpClientConnectionTimeout[50422:c07] Finished: 12.07.2013 00:07:36
2013-07-12 00:07:36.617 XamariniOSHttpClientConnectionTimeout[50422:c07] Duration: 75,468696

I can't see a bug here, the timeout seems to be set correctly:
https://github.com/mono/mono/blob/master/mcs/class/System.Net.Http/System.Net.Http/HttpClient.cs

Question: can someone reproduce this behaviour?

Official commitment plans from Xamarin regarding UrhoSharp?

$
0
0

I have been using UrhoSharp since this summer and my overall impression is that it has great potential, but I find the lack of support disturbing.
Although @EgorBo has been very helpful from time to time I want to raise the question:
Are there any official commitment plans from Xamarin/Microsoft regarding supporting and developing UrhoSharp further?
I get the impression that UrhoSharp was put together once by Xamarin and it's now up to the community to take it further!?
And that it's up to people like @EgorBo to support/develop it on their own spare time... but I might be wrong?


Is there an active UrhoSharp user out there?

Help with Components folder

$
0
0

Hello. I have a problem. After reinstalling Visual Studio 2017, the Components folder does not display in the Solution Explorer. Is it possible to manually enable the Components folder?

Im start blank Android c# projekt.

Xcode which is unsupported by the designer

$
0
0

This file has been edited in a version of Xcode which is unsupported by the designer. Documents saved in Xcode 9.2 format, or older, are supported.

Hello , Does anyone know this one?

System.MissingMethodException: Method 'Android.Support.CustomTabs.CustomTabsIntent.LaunchUrl' not fo

$
0
0

Hello guys, I am getting the above exception while trying to login through O365. This seems like a package issue. I have implemented successfully on iOS. Below line gives the exception.

App.AllDetailsObj = await App.IdentityClientApp.AcquireTokenAsync(App.Scopes, App.UiParent);

Xamarin Android Shared Library + Resources

$
0
0

I've been trying to figure out some weird issues around shared libraries and resources and am at a bit of a loss if it's perhaps just not supported?

I probably should start with a brief background -- we have a bunch of old C# apps on Windows Mobile 6.5 which we decided to port to Xamarin Android as the best path forward - lots of code reuse, etc. They were set up so some things (like the login screen, customer details screen, etc) were in separate .DLLs and you'd just add a references to whichever you needed.

When we ported the first app to Android we just got it working by adding all that shared code into the project... which works fine, but now we've finished the first port and starting working on the second we don't want to have to add the same shared code files into the next project.

So we've done a lift and shift - moved the shared components to a new DLL along with the .axml resources and at first blush it looks like it's all fine... the login screen still comes up (in both apps) and you can log in. So we continued along this path and did another component, and another and it looked like it was all fine until we started getting some weird crashes, specifically "An item with the same key has already been added."

The repro would be something akin to:
1) Go to a new sale
2) Go to product lookup -> crash "An item with the same key has already been added."
or
1) Go to product lookup
2) Go to a new sale -> crash "An item with the same key has already been added."
(you could use one or other, not both)

So I started digging around and I'm only guessing here but the Resources.Designer.cs for the library had some resources using the same (integer) id that was also used (for a different resource) in the App.

Thus begun a bunch of google-fu which drew me to the conclusion that the aapt generates these ids automatically 'per application', and that everything was considered an application by default and I probably should be passing the arg --shared-lib to aapt so that the library ids weren't going to cause a conflict with the apps ids. To do so, I added the following to the csproj of my library:
<AndroidResgenExtraArgs> -v --shared-lib </AndroidResgenExtraArgs>

This generates a slightly different R.java file (no 0x7f prefix from aapt and no 'static final', just 'static'):
public static final int txtProductStats=0x7f07010d; // this is an example id inside R.java when using default aapt settings
public static int txtProductStats=0x0007010d; // this is an example id inside R.java when using --shared-lib
R.java also has a new method: public static void onResourcesLoaded(int packageId) which seems to do an update to that id, eg:
id.txtProductStats = (id.txtProductStats & 0x00ffffff) | (packageId << 24);

None of this seems to be coming through to the Resources.Designer.cs file that's generated - it's basically empty, just a bunch of partial classes with no ids anywhere, so I'm wondering if --shared-lib is not supported by Xamarin? I couldn't find anything really either way, hence asking the question.

Is anyone else doing android shared libraries this way?
Has anyone had issues with duplicate ids causing crashes?
Is there a better way to do it?
Should we look at making these proper Xamarin components instead of a shared .DLL we just reference?

#ClutchingAtStraws :)

Viewing all 204402 articles
Browse latest View live


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