Xamarin.Android crash after upgrading to Xamarin.Forms 4.2 - xamarin.forms

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

Related

LoadApplication(new App()) fails TypeLoadException in Xamarin Forms Acr.UserDialog

I migrated my Xamarin.Forms app from Portable to .NET Standard because I need to add a function that requires the upgrade. I [finally] got everything to build, now when I start up either the Droid or iOS project, my app throws a
TypeLoadException
I was under the impression this worked a lot smoother than it actually does. I need to get back to my original task which was adding the new functionality but I have to get the thing running first. I could really use, and appreciate the help.
Thanks!

The "VsInstallRoot" parameter is not supported by the "XamarinBuildAndroidAarRestore" task

I've got a Xamarin.Forms app and when I try to build the Android app I get the following compile time error:
Target _XamarinAndroidBuildAarRestore:
/packages/Xamarin.Build.Download.0.4.9/build/Xamarin.Build.Download.targets(120,4):
error MSB4064: The "VsInstallRoot" parameter is not supported by the "XamarinBuildAndroidAarRestore" task. Verify the parameter exists on the task, and it is a settable public instance property.
/packages/Xamarin.Build.Download.0.4.9/build/Xamarin.Build.Download.targets(114,3):
error MSB4063: The "XamarinBuildAndroidAarRestore" task could not be initialized with its input parameters.
The iOS app builds fine.
I'm using Visual Studio for Mac (version 7.4.1 build 48).
I was able to get this error to go away by deleting the packages, bin, and obj folders from my solution as referenced in this Xamarin Forum:
https://forums.xamarin.com/discussion/96703/the-user7zippath-parameter-is-not-supported

Xamarin Forms InitalizeComponent call does not initialize page controls

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.

AIR - Different behaviour when the app is installed and when it runs inside the builder

we are developing an Adobe AIR app using Flex4. We are facing lot of bugs that didn't show up when we run the application inside Flash Builder (both debug mode and run mode), but when we install the app and run it, the app shows a different behaviour. Any idea ? what does it change between running the installed application in the builder and outside ?
Thanks a lot
Ok i've founded the problem using MonsterDebugger in the application running stand alone. The problem was the File.browseForDirectory(). I'm creating the File object, registering the event listener and then calling File.browseForDirectory() and that generate an exception. I switched the order, First creating a new file, then calling File.browseForDirectory() and at last register an event handler and works great.
My guess is that inside the debugger version and inside Flash Builder it takes just few more millisec and the File object is ready when i register the eventlistener but in the stand alone application AS3 code for event listener registration is executed before the File object initialization.

flex write runtime errors stacktrace to file

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.

Resources