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

Xamarin forms - Android project cannot be built anymore

$
0
0

Hi,

I created a simple solution, xcross platform, with ios project, and android project.
Xamarin visual studio 7.4 (latest), on MACOS

My solution was running properly this afternoon.
tonight, after launching my solution again to work on it, I had at first an error (don't remember, something related to csproj and path not found)
after checking the options, I cleaned the solution, and now I have this error bellow.

I don't understand what is wrong.
why suddenly the Cupidon.droid dll is not found ?
what can I do to fix it ?

the project appear in the build configuration, so I cannot do more I believe.
another bug or a mistake on my side ?
if yes, why it was running perfectly today on android, and brake suddenly without any modification ?

thanks for any help, I start to be really lost ( ios is not woring also, problem with keychain which break the deployment...)

Best regards
Olivier

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error MSB4018: The "GenerateJavaStubs" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'Cupidon.Droid, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Cupidon.Droid.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00099] in /Users/builder/data/lanes/5809/22d97e15/source/monodroid/external/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:229
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00000] in /Users/builder/data/lanes/5809/22d97e15/source/monodroid/external/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:179
at Java.Interop.Tools.Cecil.AssemblyResolverCoda.GetAssembly (Mono.Cecil.IAssemblyResolver resolver, System.String fileName) [0x00000] in /Users/builder/data/lanes/5809/22d97e15/source/monodroid/external/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:48
at Java.Interop.Tools.JavaCallableWrappers.JavaTypeScanner.GetJavaTypes (System.Collections.Generic.IEnumerable`1[T] assemblies, Mono.Cecil.IAssemblyResolver resolver) [0x00016] in /Users/builder/data/lanes/5809/22d97e15/source/monodroid/external/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers/JavaTypeScanner.cs:31
at Xamarin.Android.Tasks.GenerateJavaStubs.Run (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x0013b] in <6633a024ed374c909823f5db22e5904c>:0
at Xamarin.Android.Tasks.GenerateJavaStubs.Execute () [0x00225] in <6633a024ed374c909823f5db22e5904c>:0
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:631
at Microsoft.Build.BackEnd.TaskBuilder+d__26.MoveNext () [0x00212] in /Users/builder/data/lanes/5533/mono-mac-sdk/external/bockbuild/builds/msbuild-15/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 (MSB4018) (Cupidon.Droid)


My FCM Push notification (iOS) does not work in production.

$
0
0

Hi there, I have gone through the pain of setting up FCM push notifications on my Xamarin.iOS app, as there aren't any clear tutorials or guides to follow. The push notifications work fine when I'm in debug mode and my aps-environment is set to development in my Entitlements.plist file. However, I am having serious issues pushing my iOS app to App Store. Here are my scenarios:

  1. When the aps-environment is set development, the application loader rejects it with the ERROR ITMS-90164/90046: Invalid Code Signing Entitlements.
  2. When aps-environment is set production, I am able to upload to App Store and my FCM token registers, but whenever I try to push to it, first I get "Invalid Registration" error and then subsequently I get "NotRegistered" error. I have tried running through the whole process in Swift/Xcode and everything worked fine as expected. I have been on this issue for about a week now, is there something I'm missing out? I'll appreciate any help or direction I can get as regards this. Thanks.

Extreme drop in editor performance after update to version 7.4 (build 1033)

$
0
0

Hi,

after I updated Visual Studio for Mac 2017 to Version 7.4 (build 1033) the performance gets worse the longer I work. After working for two hours the performance is so bad that working is no longer possible and I have to reboot the system. Restarting Visual Studio alone does not solve the problem.

Example of extreme bad performance behaviour:

  • After hitting a key, it takes up to three seconds until the letter appears in the editor. I can write whole texts while the program is stuck, after the delay everything I typed appears in the editor.
  • The activity monitor shows CPU usage of up to 300% while the system is stuck after hitting a key (see screenshot)

  • After writing some code (and the delay mentioned above) all text is displayed white (instead of blue, green white etc. of the dark theme). It then takes several seconds before the code is in the correct color again.

  • Intelli-Sense takes more than five seconds to create suggestions, often it does not show suggestions at all

I'm using an MacBook Air with Mac OS Sierra (Version 10.12.6). Before the update, everything was smooth, letters appeard instantly after pressing the key, Intelli-sense never took more than maybe half a second to create suggestions.

Any help is appreciated, thanks in advance for your time.

Xamarin.Forms using shared project, and referencing a PCL. (Failed to resolve assembly)

$
0
0

Hi,
I am using Xamarin.Forms and have selected the "Shared Project".
In the solution I have added a new project, which is a PCL. I reference that PCL in Android/iOS/UWP projects.

I am trying to access an embedded resource (image) in the PCL, and referencing it via xaml using the "ImageResourceExtension".

It works when deploying to a real Android device, but when running it via "Xamarin Live Player", I get the exception:


The following errors were encountered when building and running your app:

• Failed to resolve assembly: 'Resources, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

I am using Android Xamarin Live Player 1.0.352.

Is such an issue addressed in the "Alpha Release: 1.0.402" (which I just subscribed to), or is this a new issue?

Perhaps it is wrong to use a PCL for the resources?

Thanks.
Martin

BTW: I think the "Xamarin Live Player" is going to be awesome.

RESX/PCL issue with UWP

$
0
0

Hi all. I decided to move most of my strings to a shared RESX/PCL to be used by iOS, Android, and UWP. I am not using Xamarin.Forms.

I created my shared PCL and it worked right out of the box with iOS. With UWP it was a different story. I can only get it to work with UWP, if both the target and minimum version are set to the Fall Creators Update (16299). Silly me, I thought I would have less problems on a .NET based platform.

Have I done something wrong setting up to use my shared PCL or is it true that it won't work on any version prior to the Fall Creators Update.

I have attached a sample project that illustrates the problem. It supports en-US and es. It starts in es using the language override. You can enter another language qualifier in the TextBox and it should change languages and does if minimum version is set to Fall Creators Update.

Here is a link to my guide for this work from the blog of @Cheesebaron : https://blog.ostebaronen.dk/2016/03/using-resx-files-in-pcl-for-xamarin-and.html

Thanks for any help,

Ted

Where can I get the .msi file for Xamarin 4.5.0.476

$
0
0

I currently need to build against 4.5.0.476 and unfortunately I upgraded VS2015 which took me to 4.9, which doesn't support Xamarin Components. So, I need to reinstall the previous version. Where can I obtain the 4.5.0.476 installer? The default for VS2015 is 4.2.

Thanks in advance for the assistance!

Xav.

ListView with MVVM - TapGestureRecognizer not working

$
0
0

Hi,

I'm trying to go the MVVM route and avoid doing stuff directly in the code-behind, I'm finding that trying to detect a row being clicked to invoke a command painful to implement. It would seem that there's no ItemSelected that takes a Command (but it's okay if I wanted to invoke an action in my code-behind), which is a shame, so I've tried to use the TapGestureRecognizer with no success...

XAML...

        <ListView 
            CachingStrategy="RecycleElement"
            ItemsSource="{Binding FilteredMessages}" 
            HasUnevenRows = "true"
            SelectedItem = "{Binding SelectedMessage}">


            <ListView.ItemTemplate>
              <DataTemplate>
                <ViewCell>
                    <StackLayout Orientation="Vertical">
                        <StackLayout Orientation="Horizontal">
                            <Label Text="{Binding Scheduled}"/>
                        </StackLayout>
                        <StackLayout Orientation="Horizontal">
                            <Label Text="{Binding Message}"/>
                            <Label.GestureRecognizers>
                                <TapGestureRecognizer Command="{Binding TapCommand}"></TapGestureRecognizer>
                            </Label.GestureRecognizers>
                        </StackLayout>
                    </StackLayout>
                </ViewCell>
              </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>

The View Model...

    public ContactDetailViewModel()
    {
    ...
        TapCommand = new Command(HandleAction);
    }


    void HandleAction (object obj)
    {
        Console.WriteLine("***** DOESNT GET CALLED :-( *****");
    }

I've tried to put the GestureRecognizers at different layers in the xaml (i.e. at the StackLayout, ViewCell and ListView), but none invoke my callback method, but it would appear that it's capturing the event, because the cell doesn't go grey; which is the default behaviour when I click the cell.

Any ideas what I'm overlooking here?

I could fallback to using an ItemSelected in the code-behind and delegate a call through to the ViewModel, but that's not clean.

I appreciate any insights.

Thanks,
Rob.

error updating xamarin.google.ios.maps “Object reference not set to an instance of an object”

$
0
0

I updated xamarin.google.ios.maps to 2.5.0 in the ios project

I receive this error after updating and compiling "Object reference not set to an instance of an object CmsMobile.iOS D:\Mis Proyectos\VS15\VC#\Xamarin\CmsMobile\packages\Xamarin.Build.Download.0.4.7\build\Xamarin.Build.Download.targets 52"

Take a look at this video

Thank you for your help


Which Visual studio MACOS is stable for production development ?

$
0
0

Hello,

I tried to work with Xamarin visual studio for MACOS version 7.4 build 1033.
this version is not stable at all, I have many problems, every time.
Crash, device not recognised, need to reboot the MAC ( ouch ! reboot !!! ), reboot the devices.

what version of Visual studio and / or xamarin are stable enough to be able to work in production.
I have a customer which request me to do an application using Xamarin, but I lose almost more than 30% of my time to try to making t work, instead of developing, working on my architecture, testing, etc...

thanks for any update on that.

Olivier

How to change TabbedPage bar height in Android? (Already overriding TabbedRenderer)

$
0
0

So I've created and successfully replaced the TabbedPage renderer with a custom one. However, I have no clue where it calculates the height, can anyone point me to the right method?

Zebra EMDK: barcode scanning crashes in debug with Xamarin 4.9.0.749

$
0
0

I have a barcode scanning application built in Xamarin.Android using the Zebra EMDK. Under Xamarin 4.9.0.749, it crashes 100% reproducibly at or near a call to scanner.Read():

03-09 13:27:43.043 F/        (21460): * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d15-6/xamarin-android/external/mono/mono/metadata/threads.c:3016, condition `internal' not met
03-09 13:27:43.043 F/libc    (21460): Fatal signal 6 (SIGABRT), code -6 in tid 21532 (Thread-1255)

This only happens when running in the debugger; release builds work fine. I see the same problem on various platforms including TC70X, TC75X and WT6000.

This is a regression; the same code worked fine (in both release and debug modes) with prior Xamarin versions.

I am using Microsoft Visual Studio Professional 2015, Version 14.0.25431.01 Update 3, with Xamarin.Android SDK 8.2.0.15.

The problem can be easily re-created using the Zebra sample application.

Steps to recreate:
1. Open solution.
2. Change build mode from "Release" to "Debug".
3. Clean solution.
4. Build solution.
5. Connect target device via USB cable. Ensure USB debugging is enabled and that your target device model appears next to the "Run" in the toolbar.
6. Launch application in debugger.
7. When UI appears, check "continuous" box, then press "Start" button.
8. Press and release scan trigger a few times. (Two is usually enough. Ten always is.)

Additional information:

The same crash happens regardless of the specific version of Symbol.XamarinEMDK I link against. I've tried it with the default that comes with the sample app (2.4.0.87) as well as the latest pre-release EMDK in a NuGet package (2.7.0.76), plus some 2.5.x and 2.6.x intermediate versions.

It also doesn't seem to matter what target framework I use. The sample app default (Android 4.4 KitKat) exhibits the problem, as does Android 8.1 Oreo.

ListView with MVVM - TapGestureRecognizer command is not working

$
0
0

I'm using MVVM, I'm finding that trying to detect a row being clicked to invoke a command painful to implement. It would seem that there's no ItemSelected that takes a Command, which is a same, so I've tried to use the TapGestureRecognizer with no success..
my viewcell is in c# as its bit complex to convert into xaml.

InSide ViewCell---

TapGestureRecognizer taponimgcheckuncheck = new TapGestureRecognizer();
taponimgcheckuncheck.SetBinding(TapGestureRecognizer.CommandProperty,"TapOnLogo");
imgcheckuncheck.GestureRecognizers.Add(taponimgcheckuncheck);

And my viewmodel is like---
public ICommand TapOnLogo{

        get{
            return new Command(() =>
            {
                Application.Current.MainPage.DisplayAlert("TapOnLogo","TapOnLogo","ok");
            });
        }
    }

Error mesage..."Your project is not referencing the "MonoAndroid,Version=v8.1"

$
0
0

I am trying to build a xamarin forms app and I am trying to run the androind project in the emulator and I get this message and I have not been able to find anything on it when I google it. Anyone know how I would address this?
"Severity Code Description Project File Line Suppression State
Error Your project is not referencing the "MonoAndroid,Version=v8.1" framework. Add a reference to "MonoAndroid,Version=v8.1" in the "frameworks" section of your project.json, and then re-run NuGet restore. FirstApp.Android "

FirebaseApp is not initialized on real devices

$
0
0

Hello! I'm trying to add push notifications in Xamarin.Forms.
On Genymotion it's work fine but on real devices i have an error:
Default FirebaseApp is not initialized.Make shure to call FirebaseApp.initializeApp(Context)

google-services.json is present in Android project with GoogleServicesJson BuildAction

My MainActivity:

     public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
        {
            internal static MainActivity Instance { get; private set; }
            internal static FirebaseInstanceId FirebaseInstance { get; private set; }

            public static int CurrentUserId { get; set; }
            protected override async void OnCreate(Bundle bundle)
            {
                base.OnCreate(bundle);           

                TabLayoutResource = Resource.Layout.Tabbar;
                ToolbarResource = Resource.Layout.Toolbar;

                VideoViewRenderer.Init();
                global::Xamarin.Forms.Forms.Init(this, bundle);
                string dbPath = FileAccessHelper.GetLocalFilePath("LocalDataBase.db");

                LoadApplication(new App());

                Xamarin.Forms.Application.Current.On<Xamarin.Forms.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
                UserDialogs.Init(this);
                CachedImageRenderer.Init();           

            //on real devices it return  null
                var app = Firebase.FirebaseApp.InitializeApp(this.ApplicationContext);

                Instance = this;
            }

scroll bar for label if content is more than width in xamarin.mac application

$
0
0

i have NSscrollview but the scroll bar dont appear. the width of the label remains same regardless of its content. how to make the width of the label change according to its content and enable scrolling for the view. any help would be greatly appreciated.


Non Store App Iphone.

$
0
0

What type of VS Project can be developed and run on Iphones (Corperate Phones) without being distibuted from the app store?
How can this be distributed ?

Pleae help.
Thanks

The "LinkAssemblies" task failed unexpectedly

$
0
0

Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void Xamarin.Forms.Maps.Android.MapRenderer::MoveToRegion(Xamarin.Forms.Maps.MapSpan,System.Boolean)' in assembly: 'Xamarin.Forms.Maps.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Xamarin.Forms.Log::Warning(System.String,System.String)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() WFS.Mobile.Salesman.Droid


if I change the linking option to none, then everything works fine, but not sdk assemblies only.

Minimum Android version: API Level 21
Target Android version: API Level 21
Compile using Android version: Use Lastest Platform(Android 8.0)

I tried to change the target version and compile using version, but it did not work.

Any idea on how to fix the error?

Thanks

ResourceDictionary.MergedWith and ResourceDictionary.MergedDictionaries merging but not loading XAML

$
0
0

My cross-platform App class (extends Application) contains a ResourceDictionary that I am attempting to merge with a "branding" dictionary. I cannot access any of the merged dictionary entries in my App constructor prior to creating my root page. In my App.xaml, I attempt to merge with a BrandTheme.xaml in the usual manner, first using the MergedWith idiom,

<?xml version="1.0" encoding="utf-8" ?> <Application xmlns="...xamarin.com/schemas/2014/forms" xmlns:x="...schemas.microsoft.com/winfx/2009/xaml" xmlns:theme="clr-namespace:Modern.Designer.Mobile" x:Class="Modern.Designer.Mobile.App"> <Application.Resources> <ResourceDictionary MergedWith="theme:BrandTheme"/> </Application.Resources> </Application>

(Note, I can't post links yet since I am new here.)

I also tried it using the MergedDictionaries idiom,

<Application xmlns="...xamarin.com/schemas/2014/forms" xmlns:x="...schemas.microsoft.com/winfx/2009/xaml" xmlns:theme="clr-namespace:Modern.Designer.Mobile" x:Class="Modern.Designer.Mobile.App"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <theme:BrandTheme /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> </Application>

My App constructor is currently simple, having recently been created from its Visual Studio project template,

public partial class App : Application { protected readonly NavigationPage TheNavigationPage; public App() { this.InitializeComponent(); var myLandingPage = new LandingPage(); this.TheNavigationPage = new NavigationPage(myLandingPage); var myResourceDictionary = Current.Resources; this.MainPage = this.TheNavigationPage; } }

When I examine the myResourceDictionary variable, I see that its myResourceDictionary.MergedDictionaries property is populated with the ResourceDictionary from BrandTheme.xaml, which contains nothing but some keyed Color declarations at this time, but does not contain those Color declarations! In fact, both myResourceDictionary.MergedDictionaries[0] and myResourceDictionary contains zero items in its collection.

So, while the MergedDictionaries idiom does in fact seem to merge dictionaries, within the App constructor the matching XAML is apparently not yet parsed and the dictionaries loaded. Is this by design? If so, by when should the resource dictionaries be populated and ready for use? If not, what am I failing to do to trigger the XAML processing? Otherwise, is there a bug?

  • BrandTheme.xaml is declared as an "Embedded Resource" and its custom tool is "MSBuild:UpdateDesignTimeXaml"
  • My version of Visual Studio Community 2017 is the latest, 15.6.1
  • Xamarin 4.9.0.749
  • Xamarin Designer 4.10.58
  • I am running the UWP project for this test. I have yet to test for either Android or iOS.
  • I am running under the latest Windows 10 release, 10.0.16299.248
  • LandingPage.xaml is only the intial boilerplate at this time, freshly created from the Visual Studio Xamarin page template. It contains a ContentPage and a simple text label.
  • When I embed my Color declarations directly in the high-level App.xaml they appear to my App constructor just fine.

How do you use Xamarin Android Device Manager and API below 19?

$
0
0

Hi,

I installed the Xamarin Android Device Manager and downloaded the "Android 4.0.3 ..." in the SDK and tools manager but the system image never appear in the list of system image.

There is no image below API 19, even if they are intalled.

Thanks

Problem with System.ServiceModel Versions

$
0
0

In my project directory I have one project as an empty android application. This project is just able to use the reference Sytem.ServiceModel in the Version 2.0.5.0
The Problem is, that I try to connect my App project with a server interface, means WCF-Service-Lbrary. The Service Library is just able to use with .NET Framework 4.6.1 the reference System.ServiceModel in Version 4.0.0.0 .
The point is that I got a error message in my App-project, which says, that I should add the reference to the assembly "System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

I already tried to get a lower Version of the .Net Framework. But the lowest I can get is 3.0 which works with System.ServiceModel 3.0.0.0 .
Are there any work arounds or something else I can try??

I'm using Visual Studio 2017 Community.

Viewing all 204402 articles
Browse latest View live


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