profile
viewpoint
Bret Johnson BretJohnson @microsoft Atlanta, GA Xamarin dev, working on UI tooling in Visual Studio

BretJohnson/roslynp 11

Roslyn portable (aka RoslynP) is an experimental Roslyn subset intended for use with any language, not just C# and VB supported by normal Roslyn

BretJohnson/GoalsNet 1

Goal tracker app with support for shared goals

BretJohnson/app-service-api-java-food-trucks 0

Java API App food trucks service sample

issue commentxamarin/Xamarin.Forms

[Bug] MEMORY LEAKING - DRAINING - iOS 13.4 - Element.RelScaleTo in Loop

Hi there- This seems to be taking a very long time, why was it removed from the milestone? are the developers saying the garbage collection will deal with this issue?

RobDaytona

comment created time in 15 minutes

CommitCommentEvent

Pull request review commentxamarin/xamarin-android

Pull GetUninitializedObject from RuntimeHelpers type on netcore

 using System.Threading;  namespace Android.Runtime {-	internal class ConstructorBuilder {-		static MethodInfo newobject = typeof (System.Runtime.Serialization.FormatterServices).GetMethod ("GetUninitializedObject", BindingFlags.Public | BindingFlags.Static)!;+	internal static class ConstructorBuilder {+		static readonly MethodInfo newobject =+#if NETCOREAPP3_1_OR_GREATER+			typ##eof (System.Runtime.CompilerServices.RuntimeHelpers).GetMethod ("GetUninitializedObject", BindingFlags.Public | BindingFlags.Static)!;

yep, checking if the define works and it does not :-(

marek-safar

comment created time in 22 minutes

Pull request review commentxamarin/xamarin-android

Remove custom types marking for types which XA does not own for netcore

 void TryApplyPreserveAttribute (TypeDefinition type) 			} 		} -		List<CustomAttribute> GetPreserveAttributes (ICustomAttributeProvider provider)+		IEnumerable<CustomAttribute> GetPreserveAttributes (ICustomAttributeProvider provider) 		{-			List<CustomAttribute> attrs = new List<CustomAttribute> ();--			if (!provider.HasCustomAttributes)-				return attrs;--			var attributes = provider.CustomAttributes;--			for (int i = attributes.Count - 1; i >= 0; i--) {-				var attribute = attributes [i];--				bool remote_attribute;-				if (!IsPreservedAttribute (provider, attribute, out remote_attribute))-					continue;--				attrs.Add (attribute);-				if (remote_attribute)-					attributes.RemoveAt (i);-			}--			return attrs;+			yield return provider.CustomAttributes.Where (a => {+				var type = a.Constructor.DeclaringType;+				return type.Namespace = "Android.Runtime" && type.Name == "PreserveAttribute";

ok, fixed

marek-safar

comment created time in 23 minutes

PR opened xamarin/xamarin-macios

[tests] Update test to cope with change in Xamarin.WatchOS.dll's location.

Fixes this test failure:

  • Xamarin.Linker.SdkTest.NoLLVMFailuresInWatchOS("../../32bits/Xamarin.WatchOS.dll"): AOT compilation Expected: 0 But was: 1

This regresed in 87d04ac3311fa41237046fb499d84b1f3d530995.

+1 -1

0 comment

1 changed file

pr created time in 24 minutes

Pull request review commentxamarin/xamarin-android

Pull GetUninitializedObject from RuntimeHelpers type on netcore

 using System.Threading;  namespace Android.Runtime {-	internal class ConstructorBuilder {-		static MethodInfo newobject = typeof (System.Runtime.Serialization.FormatterServices).GetMethod ("GetUninitializedObject", BindingFlags.Public | BindingFlags.Static)!;+	internal static class ConstructorBuilder {+		static readonly MethodInfo newobject =+#if NETCOREAPP3_1_OR_GREATER+			typ##eof (System.Runtime.CompilerServices.RuntimeHelpers).GetMethod ("GetUninitializedObject", BindingFlags.Public | BindingFlags.Static)!;

typ##eof is typo or intentional?

marek-safar

comment created time in 29 minutes

pull request commentxamarin/XamarinCommunityToolkit

Update BadgeIndicatorContainer visibility when BadgeView is created

Oh, probably it won't help(

Seem we should observe BadgeIndicatorContainer.IsVisible and when this property changes we will have to call UpdateBadgeViewPlacement(true)

I tried with (also with PropertyChanged)

		static Grid CreateIndicatorContainerElement()
		{
			var newgrid = new Grid
			{
				HorizontalOptions = LayoutOptions.Start,
				VerticalOptions = LayoutOptions.Start,
				IsVisible = false
			};
			newgrid.PropertyChanging += IndicatorContainerElement_PropertyChanged;
			return newgrid;
		}

		public static void IndicatorContainerElement_PropertyChanged(object sender, PropertyChangingEventArgs e)
		{
			if (e.PropertyName.Equals(nameof(IsVisible)))
				((sender as Grid).Parent as BadgeView)?.UpdateBadgeViewPlacement(true);
		}

Unfortunately it is not working maybe because UpdateVisibilityAsync is running async or I am missing something else.

Cfun1

comment created time in 31 minutes

Pull request review commentxamarin/xamarin-android

Remove custom types marking for types which XA does not own for netcore

 void TryApplyPreserveAttribute (TypeDefinition type) 			} 		} -		List<CustomAttribute> GetPreserveAttributes (ICustomAttributeProvider provider)+		IEnumerable<CustomAttribute> GetPreserveAttributes (ICustomAttributeProvider provider) 		{-			List<CustomAttribute> attrs = new List<CustomAttribute> ();--			if (!provider.HasCustomAttributes)-				return attrs;--			var attributes = provider.CustomAttributes;--			for (int i = attributes.Count - 1; i >= 0; i--) {-				var attribute = attributes [i];--				bool remote_attribute;-				if (!IsPreservedAttribute (provider, attribute, out remote_attribute))-					continue;--				attrs.Add (attribute);-				if (remote_attribute)-					attributes.RemoveAt (i);-			}--			return attrs;+			yield return provider.CustomAttributes.Where (a => {+				var type = a.Constructor.DeclaringType;+				return type.Namespace = "Android.Runtime" && type.Name == "PreserveAttribute";

There's a default branch, which uses PreserveAttribute in any namespace https://github.com/xamarin/xamarin-android/blob/9cdaf8414614d9c9c9be79e65867ace258a33683/src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/ApplyPreserveAttribute.cs#L83-L87

marek-safar

comment created time in 35 minutes

issue commentxamarin/xamarin-macios

Visual Studio for Mac. Could not locate the assembly "Xamarin.iOS"...

I see. So is it not possible to use UIKit in the shared project? That's why I had the reference in there. So that I can use namespaces like UIKit.

You need separate platform-specific projects to use platform-specific code, but you can have a shared project that exposes a platform-neutral API.

I'm not sure how it works in VS, but in VS for Mac you can create a multi-platform library projects which will set everything up for you, with a shared project that contains platform-neutral API, and platform-specific implementation projects.

This might also explain things a bit: https://github.com/mattleibow/CreatingPlatformPlugins

Also, do you know why VS 2019 doesn't complain about it on Windows? It successfully compiles and everything works on Windows.

It compiled because you had a reference to your local copy of Xamarin.iOS.dll (like you can add a reference to any .dll on your local system). The end result would be a shared assembly that would only be usable from other Xamarin.iOS projects, you couldn't use it in a Xamarin.Android project for instance.

fjavaler

comment created time in an hour

Pull request review commentmicrosoft/appcenter-sdk-android

Remove throwable files

 private UUID saveErrorLogFiles(Throwable throwable, ManagedErrorLog errorLog) th         String filename = errorLogId.toString();         AppCenterLog.debug(Crashes.LOG_TAG, "Saving uncaught exception.");         File errorLogFile = new File(errorStorageDirectory, filename + ErrorLogHelper.ERROR_LOG_FILE_EXTENSION);++        /* Set stacktrace to error log. */+        errorLog.getException().setStackTrace(getStackTraceString(throwable));

Do you mean that this report will be sent on the portal? If so, then I suggest that the report for sending is generated here and stack trace info adding to error report only once.

AnastasiaKubova

comment created time in an hour

pull request commentxamarin/xamarin-macios

[dotnet] Prevent linking out code referenced by P/Invoke

Done. You'll have to link https://github.com/dotnet/runtime/issues/45535 in #8901 yourself since I cannot other people's issues :-)

filipnavara

comment created time in an hour

issue commentxamarin/xamarin-macios

iOS 14.2 app crashes if deployed via mdm but not from appstore

Hi everybody.

I just found this issue. I think we are also facing this problem with our app. The difference though - there is not always an MDM involved.

We're partly working with Intune and Meraki, but many of our freelance workers use their own devices and are getting the app directly from the store. It still crashes.

Unfortunately I don't have a test device where this issue occurs until next week when my colleague will be back in the office. I'm also not that experienced to be honest, maybe someone could have a look at the attached log. As far as I see it looks more or less like the same issue. An excerpt from the attached log: "termination" : {"flags":6,"code":2343432205,"namespace":"SPRINGBOARD","description":"SPRINGBOARD, <RBSTerminateContext| domain:10 code:0x8BADF00D explanation:process-launch watchdog transgression: application<REDACTED>:2333 exhausted real (wall clock) time allowance of 20.00 seconds | ProcessVisibility: Background | ProcessState: Running | WatchdogEvent: process-launch | WatchdogVisibility: Foreground | WatchdogCPUStatistics: ( | \"Elapsed total CPU time (seconds): 29.310 (user 8.880, system 20.430), 24% CPU\", | \"Elapsed application CPU time (seconds): 19.979, 17% CPU\" | ) reportType:CrashLog maxTerminationResistance:Interactive>"},

UPDATE I just called my colleague again - and guess what: he reinstalled the App from the store and out of the sudden it is working again. I have no idea why this is. We changed nothing, it is the exactly same App version as before.

Not sure if this helps anyone, if I can do anything please let me know.

crashlog.txt

kodejack

comment created time in an hour

pull request commentAzure/azure-powershell

Updated security alerts tests + added Secure score types tests

@msJinLei please review as tests are ok now

giromm2ms

comment created time in an hour

issue openedmicrosoft/appcenter-sdk-react-native

unknown receiver errors

<!-- Thanks for your interest in using the App Center SDK for React Native. Please create issues only for problems specific to using the SDK for React Native. If your issue is related to App Center build only (meaning no issue building locally) or CodePush, please create an issue on https://github.com/Microsoft/appcenter instead. -->

Description

I am getting lots of unknown receiver errors as you can see on the screenshot below

image

Repro Steps

Please list the steps used to reproduce your issue.

  1. yarn add appcenter appcenter-push
  2. cd ios
  3. pod install
  4. Add #import <AppCenterReactNative.h>
  5. Add [AppCenterReactNative register]; after flipper initialization.
  6. run the app on iphone simulator.

Details

  1. Which version of the App Center SDK are you using?
    • e.g. 4.0.0
  2. Which OS version did you experience the issue on?
    • e.g. iOS 11
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • e.g. iPhone 6 simulator
  4. What third party libraries are you using?
    • N/A
  5. Run the following command and paste the output below: react-native info
info Fetching system and libraries information...
System:
    OS: macOS 11.0.1
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 147.26 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.2.0 - ~/.nvm/versions/node/v15.2.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v15.2.0/bin/yarn
    npm: 7.0.8 - ~/.nvm/versions/node/v15.2.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
    Android SDK:
      API Levels: 24, 26, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2
      System Images: android-24 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.2/12B45b - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_275 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^16.14.0 => 16.14.0
    react-native: 0.63.3 => 0.63.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
  1. If you're developing for React Native iOS, run the following command and paste the output below: pod --version

1.10.0

  1. Please enable verbose logging for your app using [MSAppCenter setLogLevel: MSLogLevelVerbose]; before your call to [AppCenterReactNative register]; (or any other SDK registration). For Android, use AppCenter.setLogLevel(android.util.Log.VERBOSE); before your SoLoader.init call (you will need to import com.microsoft.appcenter.AppCenter;). Include the logs here:

N/A becauyse the app doesn't even build.

created time in an hour

issue commentxamarin/Essentials

[Bug] Crash CapturePhotoAsync on real phones

@fzany

Thanks, @zunjae. I found the feed and the right version to use.

What version is the right?

The one that works for you. Keep trying!

That means not sure which version is right for me. Am I right?

zunjae

comment created time in an hour

issue commentxamarin/xamarin-macios

iOS 14.2 app crashes if deployed via mdm but not from appstore

Microsoft actually referenced this thread in one of their communications. Could you give us a link or a reference? It might help us reassure our customers for whom the situation has become very complicated. Thank-you.

kodejack

comment created time in an hour

issue commentxamarin/Essentials

[Bug] Crash CapturePhotoAsync on real phones

@fzany

Thanks, @zunjae. I found the feed and the right version to use.

What version is the right?

The one that works for you. Keep trying!

zunjae

comment created time in an hour

issue commentxamarin/Xamarin.Forms

[Bug] HttpClient with HttpClientHandler // Timeout is not working

Same here, the timeout seems not to be respected. The weird thing is that my request timeouts after 134 seconds on Android and after 75 seconds on iOS.

UWP is working as expected with the same code.

@gtame @samhouts have you found more information in the meantime?

Thanks, Eddy

gtame

comment created time in an hour

issue commentxamarin/Essentials

[Bug] Crash CapturePhotoAsync on real phones

@fzany

Thanks, @zunjae. I found the feed and the right version to use.

What version is the right?

zunjae

comment created time in an hour

issue commentxamarin/xamarin-macios

Visual Studio for Mac. Could not locate the assembly "Xamarin.iOS"...

Also, do you know why VS 2019 doesn't complain about it on Windows? It successfully compiles and everything on Windows.

fjavaler

comment created time in 2 hours

issue commentxamarin/xamarin-macios

Visual Studio for Mac. Could not locate the assembly "Xamarin.iOS"...

I see. So is it not possible to use UIKit in the shared project? That's why I had the reference in there. So that I can use namespaces like UIKit.

fjavaler

comment created time in 2 hours

issue commentxamarin/xamarin-macios

Visual Studio for Mac. Could not locate the assembly "Xamarin.iOS"...

You reference Xamarin.iOS from your shared project (https://gist.github.com/fjavaler/56b1647a50aa3591104a535aebdf57ee#file-collateraluploader-csproj-L279), and that won't work. You can only reference Xamarin.iOS from your Xamarin.iOS project.

fjavaler

comment created time in 2 hours

issue commentxamarin/xamarin-macios

Visual Studio for Mac. Could not locate the assembly "Xamarin.iOS"...

Here it is: https://gist.github.com/fjavaler/65378340c6757ac64b967b240bcc40f7

fjavaler

comment created time in 2 hours

pull request commentxamarin/xamarin-macios

[dotnet] Prevent linking out code referenced by P/Invoke

Not sure how to solve it. Seems like System.Net.Security.Native is missing from tvOS builds (https://github.com/dotnet/runtime/blob/3c39a5d3b8310d9adcb906718cf985d3e40122da/src/libraries/Native/Unix/CMakeLists.txt#L224) so the failure is somewhat warranted. I can place #if !NET around the code in ListExportedSymbols.cs but it will only hide the problem.

Something like this:

case "System.Net.Security.Native":
#if NET
    if (app.Platform == ApplePlatform.tvOS)
        break; // tvOS does not ship with System.Net.Security.Native due to https://github.com/dotnet/runtime/issues/####
#endif

basically file an issue and hide the problem (and add the issue to the list here: https://github.com/xamarin/xamarin-macios/issues/8901)

filipnavara

comment created time in 2 hours

issue commentxamarin/xamarin-macios

Visual Studio for Mac. Could not locate the assembly "Xamarin.iOS"...

The .csproj file that I sent you is the .csproj file for the shared project. I do have a seperate .iOS project as well. Did you want that .csproj file?

fjavaler

comment created time in 2 hours

issue closedxamarin/Xamarin.Forms

Mscorlib conflicts with system.memory

I made library project (target netstandard 2.1), using MessagePack 2.2.60. I made class BufferWriter : IBufferWriter, and use it like this: var buffer = new BufferWriter(); var writer = new MessagePackWriter(buffer);

That library is using by client app (Xamarin.Forms, netstandard2.1) and server app (netcoreapp3.1)

In server app all works ok. But in client app (XF.IOS) i got System.MissingMethodException: Method not found: void MessagePack.MessagePackWriter..ctor(System.Buffers.IBufferWriter`1).

in debugger i found that: type of IBufferWriter using in constructor of MessagePackWriter: System.Buffers.IBufferWriter`1[[System.Byte, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

and type of IBufferWriter that i use to implement in my BufferWriter is: System.Buffers.IBufferWriter`1[[System.Byte, mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e

Help please.

closed time in 2 hours

kefyru

issue commentxamarin/Xamarin.Forms

Mscorlib conflicts with system.memory

I'm sorry to hear this, but it's definitely out of our reach. you should contact the library author

kefyru

comment created time in 2 hours

issue commentAzure/aks-hci

[BUG] Incorrect PSRemoting detection -december release

Thank you! If you see more issues in code (or ideas), please let me know. I'll update wslab scenario tonight. (9AM here)

jaromirk

comment created time in 2 hours

issue commentxamarin/xamarin-macios

Visual Studio for Mac. Could not locate the assembly "Xamarin.iOS"...

It looks like you're building a netstandard2.0 project, not a Xamarin.iOS project: https://gist.github.com/fjavaler/56b1647a50aa3591104a535aebdf57ee#file-collateraluploader-csproj-L5.

If you want to build a Xamarin.iOS library, you need to use a Xamarin.iOS project as well. If you want to build a netstandard2.0 project, you can't use any API specific to Xamarin.iOS. Exactly what are you trying to do?

fjavaler

comment created time in 2 hours

more