Closed shaytate closed 1 month ago
This code works for me:
var session = new OTSession ("ApiKey", "SessionId", null);
session.Init ();
Please attach a complete sample project we can use to reproduce this.
See attached sample Sample.zip
Your sample still works for me.
Do you see this error on both the simulator and on device?
Could you please attach a full build log as well? Please remember to clean your project first (otherwise nothing will actually be built).
To get full build logs, set the log verbosity to diagnostic at the following locations:
-v -v -v -v
to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting Properties
.Then save the output to a file and attach it here.
I am using an iphone 7 device. I found that while it fails on the device, it does not fail on the iphone 7 simulator. Attached is the build log. build_log.txt
It seems you have hot restart enabled, can you try disabling that and see if that works:
IsHotRestartBuild = True
Visual Studio won't allow me to select my iphone when I have hot restart disabled. It doesn't show as an option.
Are you connected to a Mac?
I'm using VS on a Windows 10 PC and connected to remote Mac
The problem is that Xamarin.OpenTok.iOS is not compatible with Hot Restart because it contains a binding to a native library, and for some reason you can't disable Hot Restart because then you can't debug on your phone.
This seems to be an issue specific to Visual Studio for Windows, so I'm assigning it to the corresponding team.
Thank you
I can't turn off Hot Restart either since i upgraded to Visual Studio 16.9.2 I've submitted an issue as well
The VS issue has been closed.
Steps to Reproduce
Also want to mention my environment:
Expected Behavior
Init is called without error
Actual Behavior
I get the following exception:
{System.Exception: you have not allocated the native object at Foundation.NSObject.Init () [0x00012] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSObject.iOS.cs:33 at MyProject.iOS.DependencyClasses.SIP.ConnectToSession () [0x001fe] in C:\Workspace\TEKWave\MyProject\MyProject.iOS\DependencyClasses\SIP.cs:50 }
Also want to mention that the class handle and handle within the session object once it's created shows the following:
Unable to cast object of type 'Mono.Debugger.Soft.PointerValue' to type 'Mono.Debugger.Soft.PrimitiveValue'.
And the superhandle shows the following:
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'OTSession'.
Environment
Build Logs
Rebuild started... NU1603: Xamarin.Firebase.Messaging 121.0.1 depends on Xamarin.Google.Android.DataTransport.TransportRuntime (>= 2.2.4) but Xamarin.Google.Android.DataTransport.TransportRuntime 2.2.4 was not found. An approximate best match of Xamarin.Google.Android.DataTransport.TransportRuntime 2.2.5 was resolved. NU1603: Xamarin.Firebase.Messaging 121.0.1 depends on Xamarin.Google.Android.DataTransport.TransportRuntime (>= 2.2.4) but Xamarin.Google.Android.DataTransport.TransportRuntime 2.2.4 was not found. An approximate best match of Xamarin.Google.Android.DataTransport.TransportRuntime 2.2.5 was resolved. 1>------ Rebuild All started: Project: MyProjectResidential.Standard, Configuration: Debug Any CPU ------ 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Converters\InvertBoolConverter.cs(26,30,26,31): warning CS0168: The variable 'e' is declared but never used 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\AppShellViewModel.cs(140,13,140,32): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\VisitorTempListPageViewModel.cs(108,28,108,51): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\VisitorPermListPageViewModel.cs(108,28,108,51): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\VisitorPageViewModel.cs(438,21,438,32): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Helpers\XmlSerializerHelper.cs(35,30,35,31): warning CS0168: The variable 'e' is declared but never used 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Helpers\XmlSerializerHelper.cs(52,30,52,33): warning CS0168: The variable 'exp' is declared but never used 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Helpers\Util.cs(102,17,102,41): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Helpers\Util.cs(100,54,100,56): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\PartyListPageViewModel.cs(45,28,45,51): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Components\CustomBindablePicker.cs(361,62,361,104): warning CS0618: 'SelectedItemChangedEventArgs.SelectedItemChangedEventArgs(object)' is obsolete: 'This constructor is obsolete as of version 3.5. Please use SelectedItemChangedEventArgs(object selectedItem, int selectedItemIndex) instead.' 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\ProfilePages\ProfilePetListViewModel.cs(45,28,45,51): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\ProfilePages\ProfileVacationListViewModel.cs(45,28,45,51): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\ProfilePages\ProfileVehicleListViewModel.cs(47,28,47,51): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Helpers\Util.cs(174,21,174,35): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\ViewModels\ProfilePages\ProfileHouseholdListViewModel.cs(45,28,45,51): warning CS1998: This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Helpers\Sync.cs(998,46,998,48): warning CS0168: The variable 'ex' is declared but never used 1>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\Helpers\Sync.cs(1088,46,1088,48): warning CS0168: The variable 'ex' is declared but never used 1>MyProjectResidential.Standard -> C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.Standard\bin\Debug\netstandard2.0\MyProjectResidential.Standard.dll 1>Done building project "MyProjectResidential.Standard.csproj". Apple Support - iTunes installed: 'True', Installation type: 'Store' 2>------ Rebuild All started: Project: MyProjectResidential.iOS, Configuration: Debug iPhone ------ 2> Detected signing identity: 2> Code Signing Key: "Apple Development: My Name (identifier)" (C:\Users\Name\AppData\Local\Xamarin\iOS\Provisioning\Certificates\p12id.p12) 2> Provisioning Profile: "App Development" (C:\Users\Name\AppData\Local\Xamarin\iOS\Provisioning\Profiles\profileid.mobileprovision) 2> Consider app.config remapping of assembly "System.Runtime.CompilerServices.Unsafe, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.4.1" [] to Version "4.0.6.0" [C:\Users\Name.nuget\packages\system.runtime.compilerservices.unsafe\4.7.1\ref\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll] to solve conflict and get rid of warning. 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2123,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190. 2>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.iOS\DependencyClasses\SIP.cs(56,30,56,32): warning CS0168: The variable 'ex' is declared but never used 2>C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.iOS\DependencyClasses\SIP.cs(199,30,199,32): warning CS0168: The variable 'ex' is declared but never used 2> MyProjectResidential.iOS -> C:\Workspace\MyProject\MyProjectResidential\MyProjectResidential.iOS\bin\iPhone\Debug\MyProjectResidential.iOS.exe ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ==========
Example Project (If Possible)
None