System.NotSupportedException: Unable to activate instance of type PageRenderer from native handle . ---> System.MissingMethodException: No constructor found for PageRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
It happens when application is running and I change system font size and then push application icon again. (android project)
I have PageRenderer where I have googleMap.
Solved! I added public constructor with Intptr and Jniownership and added view initialization in this constructor and working perfectly
Related
Maybe related to this bug.
I receive a NotImplementedException for the following line:
serviceBusClient <- new ServiceBusClient(connectionString) // NotImplementedException
The context is as follows:
open Azure.Messaging.ServiceBus
...
let mutable serviceBusClient : ServiceBusClient = null
...
serviceBusClient <- new ServiceBusClient(connectionString) // NotImplementedException
IAsyncDisposable:
I received the same exception when removing the "new" declaration since the class no longer implemented IDisposable, but rather IAsyncDisposable:
serviceBusClient <- ServiceBusClient(connectionString) // NotImplementedException
Additional Information:
I was unable to reproduce this anomaly in a separate integration test (NUnit)
I only observe this anomaly when running a Xamarin.Forms app using the Android emulator
The same code was working two months ago
Originally observed exception using Azure.Messaging.ServiceBus version 7.3.0 (Nuget)
Also observed exception using Azure.Messaging.ServiceBus version 7.1.2 (Nuget)
Using .NetStandard 2.1
I increased output verbosity to Diagnostics without observing any additional clues
Azure.Messaging.ServiceBus (version 7.0 works)
QuickWatch:
Call Stack:
I am working on a DirectX 11 app and I am having difficulties creating an instance of IDXGIFactory7. I could not find a CreateDXGIFactory7() function so I am using CreateDXGIFactory2() like this:
IDXGIFactory7* factory;
HRESULT hr = ::CreateDXGIFactory2(DXGI_CREATE_FACTORY_DEBUG, __uuidof(IDXGIFactory7), (void**)&factory);
The difficulty I am having is that this call throws an exception when attempting to use the graphics debugger in Visual Studio 2019. I also tried IDXGIFactory6 which also throws an exception. If I change it to IDXGIFactory2 it works and I can use the graphics debugger.
This code does run and debug fine using the regular debugger, but not the graphics debugger. I get the following exception:
Exception thrown at 0x00007FFAE1513B29 in DirectXTemplated.exe: Microsoft C++ exception: GRFXTool::ToolException at memory location 0x0000004D28BFE010.
I downloaded the sample from https://www.3dgep.com/introduction-to-directx-11/ and modified it to use IDXGIFactory7 and CreateDXGIFactory2() instead of IDXGIFactory in the QueryRefreshRate() function. You will need to set g_EnableVSync = TRUE at the top of main.cpp for it to create the factory. This does generate the exception when attempting to use the graphics debugger.
This is a Windows 10 Pro x64 installation with Visual Studio v16.7.6.
Based on the comment from Roman R., the way to get around the problem seems to be to use CreateDXGIFactory2() to create an IDXGIFactory2 and use QueryInterface() on that to obtain the one for IDXGIFactory7.
Doing it this way avoids the exception and the app runs under the graphics debugger without issue.
I have a cross platform Xamarin Forms project which works fine when ran on Android or Windows Mobile.
Now I need to run it on iOS but I get an exception when the application is launched on an iPhone emulator:
"System.TypeLoadException: Could not load type 'XamarinMO.Services.DataServices' from assembly 'XamarinMO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."
The exception occurs early in the code , in the iOS AppDelegate on LoadApplication(new App());:
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App()); -- <<*** EXCEPTION THROWN HERE ***
ServicePointManager
.ServerCertificateValidationCallback +=
(sender, cert, chain, sslPolicyErrors) => true;
return base.FinishedLaunching(app, options);
}
I am unable to use the debugger to step into the code and the stack trace is as helpful as a chocolate kettle.
The exception does not seem to be related to the code inside my DataServices class as the execution does not even progress that far. My DataServices class seem not to even be instantiated - when I put a break point on the first line in DataServices constructor, the execution does not even get there. This indicates to me the issue is not related to the code inside the class per se (which works fine across a wide range of Android and Windows Mobile devices)
I found the cause.
I had to swap the System.Net.Http in the PCL with Microsoft.Net.Http. Apparently standard .NET System.Net.Http works fine with Android or WinPhone but not iOS.
Now the projects runs fine on all platforms.
I have exception in xamarin forms – in android – when closing a custom map.
I am rendering it in android and once every 5~ times I get exception when closing the page with the google maps
The exception is as follows:
UNHANDLED EXCEPTION: System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Maps.Android.MapRenderer from native handle b250001d ---> System.MissingMethodException: No constructor found for Xamarin.Forms.Maps.Android.MapRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown
I saw a post in stack overflow:
Error when navigating away from a page with a map on Android, while the on-screen keyboard is visible
and I tried to create a constructor like this:
public CustomMapRenderer(IntPtr javaReference, JniHandleOwnership jniHandleOwnership)
: base(javaReference, jniHandleOwnership) { }
But I get compilation error:
'MapRenderer' does not contain a constructor that takes 2 arguments
What is this error ??
Recently, I've noticed that for any BlackBerry project I run, the JDE throws an error with message
Exception thrown: no application instance...
I've even checked with a sample hello world project, which ends up with the same problem.
I did run clean.bat file, erase file system etc. work arounds to clear the archives, but no luck till now.
Could someone please guide me correctly what should be the fix for this?
I'm assuming the full exception is: "IllegalStateException: no application instance". Since you didn't give us many details of your code, I'll just talk about where I've commonly run into this Exception.
This is commonly caused by trying to get an application instance before you have called the Application's constructor. For example the following code will create that error:
public class HelloWorld extends UiApplication
{
public HelloWorld(){
pushScreen(new HelloWorldScreenBlank());
}
public static void main(String[] args) {
Application app = Application.getApplication();
HelloWorld theApp = new HelloWorld();
theApp.enterEventDispatcher();
}
}
This code produces the following console code:
llegalStateException
no application instance
net_rim_cldc-8(4B84A78F)
Application
getApplication
0x2EFA
HW_5$2e0(4D1A6F55)
HelloWorld
main
0x167
But the following code doesn't produce the exception:
public class HelloWorld extends UiApplication
{
public HelloWorld(){
Application app = Application.getApplication();
pushScreen(new HelloWorldScreenBlank());
}
public static void main(String[] args) {
HelloWorld theApp = new HelloWorld();
theApp.enterEventDispatcher();
}
}
This works because the Application instance is instantiated inside the constructor for the UiApplication object. Were as in the previous code we were trying to get the instance before an Application object existed.
I've commonly run into this trying to startup GPS from main() or in a static block. But there are a few classes which implicitly call getApplicaiton, so if you aren't explicitly calling getApplication then maybe one the API calls your making is. I would try to move code out of main and into your Application's constructor if you can.
Here is a Google search which will produce a list of classes from the 6.0 API which produce this exception:
throws IllegalStateException
Blackberry
site:www.blackberry.com/developers/docs/6.0.0api