I have a pretty straightforward page that has a few controls on it. My problem only occurs on an actual device and only occurs on my Lumia 1520 running Win10 Mobile version 1607 Build 10.0.14946.1000. It does not happen on my Lumia 950 running Win10 Mobile version 1607 OS Build 10.0.14393.693.
On the 1520 I un-install my app, reboot the device and then attempt to debug the app on the device. Everything works fine. I then stop debugging and attempt to start debugging again and the InitializeComponent method of my page does not initialized any of my controls.
What that means is that after this code runs:
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "0.0.0.0")]
private void InitializeComponent() {
this.LoadFromXaml(typeof(nearbyplaces));
pgHeader = this.FindByName<global::GBarScene.pageheader>("pgHeader");
lblPlacesTitle = this.FindByName<global::Xamarin.Forms.Label>("lblPlacesTitle");
btnMapAll = this.FindByName<global::Xamarin.Forms.Label>("btnMapAll");
lblDataSource = this.FindByName<global::Xamarin.Forms.Label>("lblDataSource ");
btnUseGPS = this.FindByName<global::Xamarin.Forms.Image>("btnUseGPS");
lblRatingsFor = this.FindByName<global::Xamarin.Forms.Label>("lblRatingsFor");
lblDowName = this.FindByName<global::Xamarin.Forms.Label>("lblDowName");
bvUnderline = this.FindByName<global::Xamarin.Forms.BoxView>("bvUnderline");
lvPlaces = this.FindByName<global::Xamarin.Forms.ListView>("lvPlaces");
}
Every control (psHeader, lvPlaces etc.) are all still null. (If I attempt to launch the app on the 1520 without debugging after running it the first time, it crashes)
I see nothing in the output window indicates there was a challenge in other areas. Any idea why this is happening?
UPDATE UPDATE:
So I reset the device (I got the same build etc) and tried testing again. I am now getting some error information. Below are the steps to reproduce the error as well as the error information:
Un-install any previous version of the app from the Device.
Restart the device
Test the app on the device. (It should work fine.)
Click the Stop button in the Visual Studio 2015 environment
At this point simply click the Run button in Visual Studio without making changes in the App, it will launch fine on the phone.
Click the Stop button in the Visual Studio 2015 environment
Make a change in the main page of the application and recompile. Ensure the Build line shows at least 1 project succeeded and not just all up to date or skipped.
2 succeeded, 0 failed, 0 up-to-date, 2 skipped ==========
Run the application on the Device again.
An error is generated at the LoadApplication line shown below:
public sealed partial class MainPage
{
public MainPage()
{
this.InitializeComponent();
this.NavigationCacheMode = NavigationCacheMode.Required;
LoadApplication(new GBarScene.App());
Below is the error information:
An exception of type 'System.ArgumentNullException' occurred in
Xamarin.Forms.Platform.WinRT.ni.DLL but was not handled in user code.
I click on the View Details and I see the following information:
"Value cannot be null.\r\nParameter name: newRoot"}
I hope this helps in getting this problem resolved.
UPDATE:
The problem also happens on my Lumia 640 XL that was upgraded to Win 10 Mobile.
Related
Please I need your help on this issue that I'm facing since 2 days now.
I'm using Rotativa.AspNetCore to export view in pdf with asp.net core 5, my code is working fine from visual studio 2019 but when I publish the app I'm getting this error:
Error. An error occurred while processing your request. Request ID:
00-4b8009f0978a2748b2467f7601bf7758-4639da00167d8849-00
Development Mode Swapping to Development environment will display more
detailed information about the error that occurred. The Development
environment shouldn't be enabled for deployed applications. It can
result in displaying sensitive information from exceptions to end
users. For local debugging, enable the Development environment by
setting the ASPNETCORE_ENVIRONMENT environment variable to
Development and restarting the app.
here is my code:
public async Task<IActionResult> RibExport(string account)
{
rib_pdf rib = new rib_pdf();
var pdf = new ViewAsPdf()
{
ViewName = "RibExport",
FileName = "Rib.pdf",
Model = rib,
PageHeight = 200,
PageOrientation = Rotativa.AspNetCore.Options.Orientation.Landscape,
};
return pdf
}
I'm populating my rib model from my code for the contents.
I can't see any error from my logs files.
I do have:
wkhtmltoimage.exe
wkhtmltopdf.exe
from rotativa folder.
It seems is related with the IIS application pool identity permission issue. I suggest you could firstly set it as system to see if it could resolve this issue.
Like below:
If this has solved your issue, then you could run process monitor to see which permission is needed for accessing the temp folder, after checking it, you could modify the default identity provider IIS APPPOOL\DefaultAppPool's permission to solve this issue
I have created a brand new Uno project and off the bat I get compile errors. I most common one I am getting is a cs 1061 App does not contain a definition for InitializeComponent. The app would run with this error, but once I start adding more pages to the application, the application no longer compiles. How do I resolve this issue? Also, I get this same error for each page that I add. The oddest part about this issue is that the app.xaml.cs suffers from it too.
I am also getting a XLS0411 that is complaining about the background brush that comes with the default page.
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
The message about InitializeComponent() is a false positive from Visual Studio, this is a known issue. The Uno Platform documentation recommends to build the project once, close the solution, and then reopen it to get rid of this error.
In general the Error window is less useful with Uno Platform projects because of the various false positives, it's more reliable to check the Build pane in the Output window. The Error window is Intellisense's best guess as what errors your code may have; the Build output is what actually happened when it tried to compile. If you search for "error " from the top of the Build output you should quickly find the reason the compilation failed; this will tell you why it's failing when you add pages to the application.
I upgraded to Xamarin.Forms 4.2. For Android, it crashed immediately after launch.
The error message is
Your app has entered a break state, but there is no code to show because all threads were executing external code (typically system or framework code).
After tracing through the code, the app has launched and there is no code left to execute. Then, it crashed.
Thanks Lucas. As suggested, in SplashActivity.cs, change the class declaration to
public class SplashActivity : global::Android.Support.V7.App.AppCompatActivity
I am using the example code from the ZXing page .
Details are :
Windows 10 Pro N, Visual Studio Enterprise 2015 ,
Xamarin.Forms 2.3.1.114 , ZXing.Net.Mobile 2.1.47 ,
ZXing.Net.Mobile.Forms 2.1.4.7
I am using below code
btnScan.Clicked+=async(sender,e)=>{
var scanPage = new ZXingScannerPage ();
await Navigation.PushModalAsync (scanPage);
scanPage.OnScanResult += (result) =>
{
scanPage.IsScanning = false;
Device.BeginInvokeOnMainThread (async () =>
{
await Navigation.PopModalAsync ();
await DisplayAlert("Scanned Barcode", result.Text, "OK");
});
};
}
Also I have added the below line in the MainPage.xml file of the UWP project just before LoadApplication method call
ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingBarcodeImageViewRenderer.Init();
Also I have provided access to the WebCam from the application manifest.
When I run the application in Debug or Release mode in the emulator then it opens the scanner but small black/white /red /green square comes and computer webcam is not accessed.
When I run it as windows 10 app then nothing comes, only blank screen comes.
When I run it in the real windows 10 mobile, then scanner opens but camera doesn't opens, the white screen with red line opens and camera doesn't activates.
The same thing happens with WIndows 8.1 also.
Any help would be deeply appreciated. I have wasted lot of time to explore the internet used almost every combination. If anyone have the solution please please provide me.
Note:
The above code works fine for Android and I am able to scan the bar code and QR code.
I have tried all options given by users in different forums, but none of them were working.
if you are also facing same issue then please check you camera. If you are using Windows Pro N or KN version, then you have to install the media feature pack to make camera working.
I installed the media fature pack for windows K and KN versions but still it was not working.
When I try to open the Camera App then also it was saying that Media Fature Pack Required for Windows K and KN versions.
Finally I installed Windows 10 Pro version (removed Pro N/KN version) and reinstalled VS 2015 and tried of of the solution given by user at xamarin forum
https://forums.xamarin.com/discussion/76035/zxing-scanner-camera-is-not-activating-in-uwp-and-wp-8-1#latest
But still I am still facing this issue for WP 8.1
I am developing a Flex + AIR application. While debugging using Flash Builder sometimes I get runtime errors dialog with 'continue' & 'dismiss all' buttons. But when I release a build(.air) & run the application after installing. Then I don't get the same dialog in the release build.
I need to track these types of runtime errors for that I am trying to write them to a file as logs.
I tried using try catch & writing to file in catch block, but I am not able to get any wayout for unhandled exceptions or runtime errors.
Is there any way to achieve it?
Thanks in advance.
The error dialog is displayed only if you use the debugger version of Flash Player.
You could register an UncaughtErrorEvent handler and log the errors with trace or with the logging API:
private function onApplicationComplete():void
{
loaderInfo.uncaughtErrorEvents.addEventListener(
UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);
}
private function onUncaughtError(event:UncaughtErrorEvent):void
{
trace(error);
}
You can't debug compiled AIR application with the Flash debug player because the debug information is removed when you make a release build. You can use something like De MonsterDebugger to output error information, but generally it's a bad idea to show error info in a release build. You should be testing prior to releasing.
In Flash 11.5+ it is now possible to get the stack trace at runtime using error.getStackTrace() see http://renaun.com/blog/2012/09/getting-the-stack-trace-in-a-release-flash-player/
It is working for me in an Air application.