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

Problem with GeoLocator Plugin

$
0
0

Hi,

Just started using Xamarin and got an issue with the GeoLocator Plugin
I'm using Xamarin 4.7.10 with Xamarin Android 8.0.2.1 in VS.Net 2015 U3, using a AVD Nexus 4 Android 7.1.1 Intel Atom x86.

Created my first project, added a button and added the clicked event

    private async void Button_Clicked(object sender, EventArgs e)
        {
            await Static_Functions.AddGPSTrackingRecord();
        }

The function that handles the GPS part :

    internal async static Task AddGPSTrackingRecord()
        {
            var locator = CrossGeolocator.Current;
            if (locator.IsGeolocationAvailable && locator.IsGeolocationEnabled)
            {
                var location = await locator.GetPositionAsync(new TimeSpan(5000));

                if (location != null)
                {
                    GPSTracking newTrackingRecord = new GPSTracking();
                    newTrackingRecord.Latitude = location.Latitude;
                    newTrackingRecord.Longitude = location.Longitude;
                }
            }
        }

Unfortunately the app crashes in the await.locator statement.
No call stack, only a 'An unhandled exception occured.', breaking shows no code because all threads were executing external code.

Any Idea's on what should have gone wrong, seems to me to be something straightforward, no?

Regards,
Sven Peeters


Load Image form byte[] array.

$
0
0

Hi,
there is the posibility to load in the Xamarin.Forms Image an Image from a byte[] array?

Thanks

Xamarin Forms - Download and retrieve - IOS

$
0
0

Our requirement is download file from given url and store into app. Next time on wards if the file is available locally, it should read locally, if not it should pull from url.

While downloading i noticed it is downloading under Guid folder like below. Everyday new GUID will be created and System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments) will target to newly crated GUID.

My Question is : How to identify folder which was created on yesterday ? Is there any way to store in permanent location in IOS ?

Sample folder structure :
/Users/venkat/Library/Developer/CoreSimulator/Devices/C5A275D1-40C5-4F1F-87B4-21FC56B02131/data/Containers/Data/Application/CBADEC65-7F5D-400D-810A-7D163C335E8B/Documents/xxx.json"

//To store file into app
string path = CreatePathToFile(filename);
File.WriteAllText(path, text);

//To read file from app
string filereader;
string path = CreatePathToFile(filename);
using (StreamReader sr = File.OpenText(path))
{
filereader = sr.ReadToEnd();
}
return filereader

static string CreatePathToFile(string fileName)
{
string fullPath = Path.Combine(
System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments),
fileName);
return fullPath;
}

Xamarin.iOS code sign error using iOS 11.1

$
0
0

I'm trying to build my iOS application using my new iOS build machine using iOS 11.1.

However when I build my application I get the following error:

        15>  Codesign: 2017-12-05T17:13:01.9997912+00:00 - Logging messages
        15>  Codesign Task
        15>    CodesignAllocate: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
        15>    DisableTimestamp: True
        15>    Entitlements: obj/iPhone/Debug/Entitlements.xcent
        15>    Keychain: <null>
        15>    Resources:
        15>      bin/iPhone/Debug/MyApp.iOS.app
        15>    ResourceRules: <null>
        15>    SigningKey: 1F4A95333C89923DCB777A2DC213ED088E28D9D1
        15>    ExtraArgs: <null>
        15>    IsAppExtension: False
        15>  Tool /usr/bin/codesign execution started with arguments: -v --force --sign 1F4A95333C89923DCB777A2DC213ED088E28D9D1 --entitlements /Users/me/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS/8e10175d0d7b53fc009bbcaa305356f0/obj/iPhone/Debug/Entitlements.xcent --timestamp=none /Users/me/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS/8e10175d0d7b53fc009bbcaa305356f0/bin/iPhone/Debug/MyApp.iOS.app
        15>  Tool /usr/bin/codesign execution finished (exit code = 1).
        15>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(1837,3): error : /Users/me/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS/8e10175d0d7b53fc009bbcaa305356f0/bin/iPhone/Debug/MyApp.iOS.app: unknown error -1=ffffffffffffffff
        15>  Codesign: 2017-12-05T17:13:02.0022906+00:00 - Finished
        15>Done executing task "Codesign" -- FAILED.
        15>Done building target "_CodesignAppBundle" in project "MyApp.iOS.csproj" -- FAILED.

I have already created a new signing identity and provisioning profile and still the same error
If anyone has come across this in the past any information would be really appreciated.

XAML : Cannot add Viewcell inside datatemplate

$
0
0

Dear Xamarin Forum,

I seem to be unable to add a in my xaml and am actually unable to place anything in my

Does anyone know why this is happening and how to fix this?

Example XAML code:


        <ListView x:Name="newsList" ItemTapped="listView_ItemTapped" IsPullToRefreshEnabled="True" RefreshCommand="{Binding RefreshNewsCommand}" IsRefreshing="{Binding IsCurrentlyRefreshing}">

            <ListView.ItemTemplate>

                <DataTemplate>

                    // cannot add anything at all!

                </DataTemplate>

            </ListView.ItemTemplate>

        </ListView>

    </StackLayout>

Xamarin.Form load dependencies dlls to apk and ipa

$
0
0
  • I am implementing a Xamarin Forms solution which has the Shared logic as a .NET Standard project => A.
  • I have some separate logic in another .NET Standard project => B which is referenced by project A and project B has couple of C++ dlls as dependencies.
  • The solution builds fine and when I run inside the android simulator, it crashes while executing logic in Project B, getting Dllnotfoundexception for one of the C++ libraries.
  • I have all the dlls inside the bin folder.
  • So what is the right way to compile these dlls into the Android apk and iOS ipa to avoid this types of exceptions.
  • Taking into consideration, I can't build them natively for Android or iOS.

Plugin.Connectivity 3.0.3 & 4.0.0.171 Pre-release versions Issue for Xamarin Android

$
0
0

Am getting the below mentioned error while accessing Crossconnectivity properties in Xamarin Android. But it is working fine in Xamarin IOS
Java.Lang.ClassNotFoundException: while crossconnectivity.current

I had tried in Plugin.Connectivity 3.0.3 & 4.0.0.171 Pre-release versions

Java.Lang.ClassNotFoundException: while crossconnectivity.current

$
0
0

Am getting the below mentioned error while accessing Crossconnectivity properties in Xamarin Android. But it is working fine in Xamarin IOS
Java.Lang.ClassNotFoundException: while crossconnectivity.current

I had tried in Plugin.Connectivity 3.0.3 & 4.0.0.171 Pre-release versions


Mac Certificates - Not able to sign the app with Developer ID application certificate

$
0
0

We are planning to distribute our MAC app out of app store. We face some problem in signing the app.
We created Developer ID application and developer ID Distribution certificates. We have given these certificates in MAC signing options. Here we have checked ‘Sign the application Bundle’ and given the identity as Developer ID Application and selected the correct Provisioning profile. Then we have selected the ‘Sign Installer Package’ option and given the Developer ID installer. We are getting a dialog (Provisioning Profile) with a message 'No Valid Provisioning Profile Found' when we click on Sign and Distribute button while archive and Publishing.

We are able to sign with Mac App Distribution certificate. But we are not able to sign with Developer ID Application and Developer ID installer certificates (For outside app store) . Please help us to resolve this issue.

Insights reports crashes of Mono since update to the newest version

$
0
0

I'm having a weird problem since I updated to the latest version of Xamarin. My App is behaving normally but in Xamarin Insights I get reports of a crash.

I'm getting a System.ObjectDisposedException at Mono.Net.Security.MobileAuthenticatedStream.

The complete stack trace that Insights shows me is only 3 lines long, which is not very helpful. And although Insights reports a crash, the app itself is not crashing at all.

I searched the internet and StackOverflow but I didn't find a solution so far. Maybe anyone in here has experienced some similar issues or knows how to fix this.

Im currently using:

Visual Studio for Mac: 7.3 (build 797)

Mono: 5.4.1.7

Xamarin.iOS : 11.4.0.214

The link below stack trace is all i get from Xamarin Insights.

System.ObjectDisposedExceptionCannot access a disposed object. Object name: 'MobileAuthenticatedStream'.

null

System.ObjectDisposedExceptionCannot access a disposed object. Object name: 'MobileAuthenticatedStream'.
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Mono.Net.Security.MobileAuthenticatedStream.d__58.MoveNext()

How can i use GradientDrawable.SetCornerRadii(float[])?

$
0
0

This is the code i use:

float[] cornerRadii = new float[8];
cornerRadii[0] = Forms.Context.ToPixels(topLeftRadius);
cornerRadii[1] = Forms.Context.ToPixels(topLeftRadius);
cornerRadii[2] = Forms.Context.ToPixels(topRightRadius);
cornerRadii[3] = Forms.Context.ToPixels(topRightRadius);
cornerRadii[4] = Forms.Context.ToPixels(bottomRightRadius);
cornerRadii[5] = Forms.Context.ToPixels(bottomRightRadius);
cornerRadii[6] = Forms.Context.ToPixels(bottomLeftRadius);
cornerRadii[7] = Forms.Context.ToPixels(bottomLeftRadius);

if(cornerRadii[0] > 0 || cornerRadii[1] > 0 || cornerRadii[2] > 0 || cornerRadii[3] > 0 || cornerRadii[4] > 0 || cornerRadii[5] > 0 || cornerRadii[6] > 0 || cornerRadii[7] > 0)
{
mBackground.SetCornerRadii(cornerRadii);
}

I'm new in xamarin forms development and i haven't found any example how to use this method. I want to create a CustomRenderer for the Entry class,
which will have the top left and bottom left corners with a radius.

Ios app crashing frequently and intermittently in debug mode

$
0
0

Hi,

I am getting the following error during the app crash in the debug mode --

Assertion at "~/source/xamarin-macios/external/mono/mono/mini/debugger-agent.c:4714, condition `array->len == 1' not met"

Version of Xamarin Ios on Mac agent: 11.2
Version of Xamarin.Ios and Xamarin.Mac sdk on windows -- 11.2.1.0
Visual studio version -- Enterprise 2017, Version 15.4.2

Could you please help me here? Tried reinstalling Xamarin and VS several times, assuming it was an installation issue, but it did not work.

Tried running the simulator on windows as well as Ios, and was able to reproduce the issue in both cases.

Thanks

OCR (handwriting recognition) and Speech Recognition with Xamarin

$
0
0

Yo! The title says everything... is it possible? i found a few libraries but... i can't import them using NuGet (Visual Studio) so... what can i do?
i wanted to use System.Speech from Microsoft and IronOCR
but what i really want to know: why is cross platform OCR and Speech Recognition so difficult? i mean... it's just math isn't it? i don't see any hardware specific problems there. i really don't understand it.

HexaGames2017 - Android Games Developer

$
0
0

Hi All,
Below is HexaGames2017 PlayStore Page where you can get the android games for your android device.
Http://goo.gl/aAXCJ7
Best Regards

Need Xamarin Developer For IOS - Video Calling App

$
0
0

Hi, I am looking for a xamarin developer to help me build a video calling app. Please email me at pradeeprajudat@gmail.com with subject "Xamarin-Video App"


Error with OnPlatform and x:TypeArguments="x:Double" on xaml

$
0
0

Why this xaml

 <BoxView HorizontalOptions="Fill" VerticalOptions="Fill" BackgroundColor="Red" >
            <BoxView.HeightRequest>
                <OnPlatform x:TypeArguments="x:Double">
                    <On Platform="iOS">20</On>
                    <On Platform="Android">50</On>
                </OnPlatform>
            </BoxView.HeightRequest>
        </BoxView>

gives me the error No property, bindable property, or event found for 'HeightRequest', or mismatching type between value and property on 2.5.0.121934?

Numerous developer frustrations

$
0
0

Hi everyone,

I would like advice streamlining my development experience with Xamarin because it has been quite frustrating so far.
I even got to the point that I left my project which was working for a month or 2 and returned with it crashing and me not being able to get it up and running again, after which I decided I was going to rebuild it from scratch.

I can't imagine that my current debugging problems are the norm so I guess I must be doing something wrong somewhere. I'd like to find out what.
It could be so that half of my problems are not Xamarin related but Visual studio related, but I don't seem to be experiencing them when I'm developing other type of applications.

I have a firm background in developing console / wpf / asp / webapi / etc c# projects but I'm still kinda new to Xamarin.
I'm trying to build a Xamarin forms app (focussing on android first, if I get that up and running then maybe also IOS / UWP)
I mostly use the android emulator with an newly created AVD (platform 7.1.1 api level 25)

Why am I frustrated:

  • when my code breaks my dev environment (vs 2017 on win10) almost never stops where the problem occurs (nullreference / throw exception) it just seems to crash hard on the emulator. I have to step through my code or use the output window to see if I can decypher a cause. I usually get an "An unhandled exception occurred" message with "no compatible code running".
  • errors that I get to see are often not helpfull in diagnosing the problem.
  • quite a lot of times the app just crashes on startup in the emulator, not giving me any log.
  • given the points above I try to take babysteps to verify it still works. This in combination with the slowness of the debuggingcycle (buidling/deploying) on an android emulator takes the speed out of my development.
  • I seem to be getting different results from time to time between debugging on my physical device / the emulator / after a solution clean / reboot. That does not help in my general feeling of building on a solid foundation.
  • the logcat output of my emulator produces a lot of noise (warnings / errors) not related to my application
  • the output window which shows during the debugging seems to contain a lot of errors (red text) that do not relate to problems (they also appear when the app is functioning fine) for instance D/Mono (28288): AOT: image 'System.ComponentModel.TypeConverter.dll.so' not found: dlopen failed: library "/data/app/com.companyname.MyCompany-1/lib/arm/libaot-System.ComponentModel.TypeConverter.dll.so" not found

Things I've chosen to do which might impact my current experience:

  • use .net standard (2.0) instead of pcl
  • use packagereferences where I can instead of packages.config
  • using freshmvvm with it's IOC to resolve services

Things on my mind that I could be doing wrong:

  • some kind of debugging setting is wrong
  • I am not aware of some debugging strategy that exists and could make my life easier diagnosing problems
  • some kind of build problem that prevents de debugger on the emulator from working correctly (getting errors like 12-08 11:00:39.404 D/Mono (28288): AOT: image 'System.ComponentModel.dll.so' not found: dlopen failed: library "/data/app/com.companyname.MyCompany-1/lib/arm/libaot-System.ComponentModel.dll.so" not found)
  • am I using the right kind of emulator?

My current debugging tools

  • output window
  • error list
  • stepping through code
  • device log (logcat)

Any help would be appreciated

Question about Calabash Announcement

$
0
0

It was announced today that development for Calabash is ending, and support for it will eventually end. My question is: How/Does this affect UITest? My understanding has always been that UITest is built on top of Calabash. Does ending development (and eventually support) for Calabash mean UITest suffers the same fate?

I can not add Apple Developer Account (Apple ID) to Visual Studio Mac 7.3

$
0
0

I am getting the following error in the ide.log:

[19:11:43]: [33mGet started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile[0m
Credential ****appleid****:************* added to keychain.
INFO [2017-12-07 19:11:52Z]: Syncing ****appleid**** developer info...
INFO [2017-12-07 19:11:55Z]: Syncing developer teams
INFO [2017-12-07 19:11:56Z]: Processing details of ****team**** team...
WARNING [2017-12-07 19:27:54Z]: Gtk-Warning: Can't set a parent on widget which has a parent

Stack trace:
at Gtk.Widget.gtk_widget_set_parent (System.IntPtr , System.IntPtr ) [0x00000] in <861b978b87fe48cdaecc06b6d5833139>:0
at Gtk.Widget.set_Parent (Gtk.Widget value) [0x00022] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/gtk-sharp-None/gtk/generated/Widget.cs:58
at Mono.Addins.Gui.AddinManagerDialog.OnShown () [0x00006] in /Users/builder/data/lanes/5402/ff055b3e/source/monodevelop/main/external/mono-addins/Mono.Addins.Gui/Mono.Addins.Gui/AddinManagerDialog.cs:189
at Gtk.Widget.shown_cb (System.IntPtr widget) [0x00010] in /Users/builder/data/lanes/4992/mono-mac-sdk/external/bockbuild/builds/gtk-sharp-None/gtk/generated/Widget.cs:957

****appleid**** is my apple id email address and ****team**** is my team name.

I have tried to reinstall fastlane and have also tried reinstalling VSMac with no change.

I have tried all the trouble shooting things listed here:
https://developer.xamarin.com/guides/cross-platform/macios/apple-account-management/

I can see that the error could be related to the known issue of the VS window not getting focus back, but I have tried now several times as suggested and it still does not work.

I know that I have to enter my computer login credentials when the deliver.* dialogs popup and just click allow all, I am doing that.

So is this a bug or am I doing something wrong ?

menu attribute is not recognized

$
0
0

I am stuck for hours on that. I searched all the questions and answers on related matters but no solution works and i start getting disappointed.

 <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/activity_main_drawer" />

Error :
No resource identifier found for attribute 'menu' in package 'MobiDroid.MobiDroid' MobiDroid ~\MobiDroid\MobiDroid\Resources\layout\Main.axml

All tutorials i've seen show same code and it suppose to work. I made new project trying the same but still... Resource.Designer.cs generates Menu only if i change the name of the folder to Menu(from menu). Still the xml doesn't recognize it.

PS
why is has to be so hard to make a menu file and import it on my xml?(it's rhetoric) Sometimes i reconsider the Xamarin.Native approach due to the time it takes to solve small puzzling issues. The overall time consumed fixing those matters messes with the deadlines

Thanks in advance

Viewing all 204402 articles
Browse latest View live


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