Clear AIR Mobile application data in IntelliJ - apache-flex

I'm developing a mobile AIR application using IntelliJ.
When debugging in Flash Builder there is an option to clear to application data on each (debug) launch of the ADL (see screenshot below) However, I can't find this setting in IntelliJ or some ADL parameter to force a clear on each new debug session. I was wondering if such an option exist in IntelliJ or ADL.
A little background: I'm using the PersistanceManager in the application to store some user settings and I want to be able to start the application without the saved settings from my previous run. Using this setting in Flash Builder does the trick, but I'm having no luck with IntelliJ.

Not sure, never had to do that before, but I believe that if you do a "clean" before rebuilding, that should clear out the PersistanceManager.

Yes im still trying to find a solution for this.
The reason this happens is because when you are testing on the device, for some reason IntelliJ sends an uninstall command to the device so it wipes clean everything.
I tried to run my own compiler arguments, but the uninstall command has higher priority so i can't cancel it yet. I think a good solution could be using ant tasks: http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

Related

UWP: Access violation happens only in release mode

I am new to UWP. I have just ported a quite complicated WPF app. It took me several weeks to figure out every difference and refactored a lot of code. However when I start to build and run in release mode I get an Access violation exception.
How is this even possible? Aren't debug and release execution supposed to be the same? How can I debug this problem if it occurs only in release?
If I turn native compilation off, the release build runs without a problem. However, when I try to install it on the device, a NetCore 2.2 debug framework is required. What is this debug framework and why cannot I run my release code without it?
I used to develop for AspNetCore and those things can run even on Linux. I really do not understand how is a UWP app cannot run on a Windows 10 tablet without a special debug framework.
I am kind of lost here. Any help or guidance is much appreciated. Thanks
EDIT:
As for the conclusion: I needed to create the app again from scratch. I started copying everything from the old app class by class. It was worth the effort not just because I refactored a lot of code :) but finally found what was causing the crash. I had a dependency in one of my libraries to an older version of System.ServiceModel.Primitives NuGet package. In Debug build, even with Native Compilation, the runtime managed to resolve the package. However, in Release it could not.
It was quite a journey that made me to develop a better software. However I could avoid it by releasing more often from the beginning, or the if the runtime would show more informative error messages about assembly resolution problems.
The .NET Native compilation tends to cause problems for apps and it is recommended to try and run the application frequently in the release mode to catch potential issues as soon as possible. Usually any reflection-related code should be checked well, as those usually are the source of problems.
I would suggest going back in time (if you have some kind of source control) and try earlier builds of your app to pinpoint the time when the app stopped working. Alternatively, you can try commenting out parts of the code until the release build starts working. Finally, it is also possible to create a blank project and sequentially copy code and run it to locate the problem.
.NET Native is an annoying aspect of UWP app development and Microsoft is aware of this - the plan is .NET Native will no longer be required anymore soon (most likely before .NET 5 comes) and later there will be a more predictable replacement.

chromium profile directory is already/used by another BrowserContext instance or process

I used an evaluated jxbrowser, which version is 6.14, I write an demo to use it. but i have a problem with it.
Use the demo app to start an application, which can show web UI, keep this applciation with opened, but then I start demo app again, system will throw below exception:
chromium profile directory is already/used by another BrowserContext instance or process
jxbrwowser cannot start two clients in one PC? if can, how to resolve it?
We strongly recommend that you don't use several BrowserContext instances with the same profile directory. Chromium engine wasn't designed for such usage and doesn't support it. Even if you don't see any issues right now, the issues will appear later in end user environments. For example, in macOS environment you will get the Chromium's error message dialog every time when you run your application instance developed in such way.
Since it's a critical requirement in the Chromium engine, I don't think we will make it configurable in next versions. This is how Chromium engine works. These is a recommendation we have to follow when working with the Chromium engine.

Flex release build issue (AIR application)

I have an issue on exported build release from Flash Builder 4.6. The case is when I run it on the IDE(Flash Builder 4.6) it works fine, no issues encountered, it never crashed but when I exported it for a release build and run, it crashes to a certain module/view. The view/module where the AIR app crashes has multiple remote object calls (minimum of 5). I have noticed that when requesting multiple remote object calls(like 5 remote calls at a time) it crashes. Is the remote object causes the crash? Please help me out on this guys, any idea will be much appreciated.
Thanks
Glen
I bet it's a security issue that you worked around when invoking the application from the ide. By default, Flash Builders working directories are marked as "secure", so you don't get any security issues. But when working on the live system, you might need to have a corssdomain policy.
Also: i suggest to use the Thunderbolt logger with the logging framework. This allows you to get log informations straight into your browser's console.

Adobe AIR NativeProcess - UAC problems when trying to run update installers

I'm trying to use Adobe AIR 2's NativeProcess API to emulate the ApplicationUpdater but I'm encountering problems when I try to run the downloaded AppUpdater.exe file on computers with UAC (User Account Control) enabled.
When run without UAC enabled, the AppUpdater opens as usual and displays the standard Adobe replace dialog box. With UAC enabled, nothing happens at all.
Having run a few traces, it seems the problem arises when I call NativeProcess.start() - the code seems to stop running at this point, and does not run the following lines which exit the application in preparation for the AppUpdater to run.
I have added listeners for all of the possible events and error events that can be thrown, and added logging in each of them, but none of these are producing any output.
This issue only seems to affect installation executables (ones which windows warns will change settings on your computer). Calling java.exe -jar .... on the same computers in the same application works correctly.
I'm at a loss, so any help would be amazing!
After speaking to Adobe directly, I discovered that NativeProcess uses a windows API which is unable to elevate privileges which is why the installers wouldn't work. The workaround was to use File.openWithDefaultApplication which uses a different API that can elevate privileges, but this only works in a native-packaged AIR app (which was just fine for our app since it was already packaged in a native installer :))
adobe answer was http://kb2.adobe.com/cps/404/kb404888.html
but for real steps you should determine the application user privileges and determine UAC enabled, if yes - then warn end-user about it.
I'm expecting that you could do nothing with windows-thing from Adobe Air.

Severe Flex issues

I seem to be having difficulties getting the trace function to output anything to the console in either Eclipse with the Flex Plug-in, Flex Builder, or even FlexBeans (the Netbeans plug-in for Flex). I have removed and then reinstalled the Flash player 10 debugger version for both Firefox and IE, rebooting after uninstalling them and then after re-installing them. I have removed all old versions of Java and updated to the most recent version.
mm.cfg is configured correctly to allow the trace actions to appear in flashlog.txt
I tried removing the Flex Plug-in for eclipse to re-install, and now that I re-installed, I cannot create new Flex projects. I would rather not uninstall Flex Builder for fear that it will also behave strangely.
ANY ideas would be useful. Ideally, I need the plug-in to work, but any way I could get tracing to output to the console (in ANY IDE) would be better than what I have now.
I'm not sure what you mean by "Flash debugger for both Firefox and IE"; are you referring the debugger versions of the Flash Player available here?
http://www.adobe.com/support/flashplayer/downloads.html
If not, you definitely need those installed in order to be able to write trace() output to the IDE console.
I'm almost positive that this is not the issue, but it has confused me on a couple of occasions.
The Debug Application (as opposed to Run Application) keyboard command is different on Mac and PC. I use both and have gotten them mixed up, which results in my Running when I think I am Debugging, which of course leads to know trace outputs in the console.
Most likely not it, but doesn't hurt to mention it (I hope) :)
-- Evan
How are you testing the debugger? Have you tried going somewhere like with lots of ads that generally still have their traces in? Or are you just testing it with your own swfs? Have you installed the projector debug version? How is eclipse / flex configured to launch test swfs? Is it in the browser, or in the stand alone player? Do you have any weird mxmlc settings?
I assume you've followed all these instructions?
http://kb2.adobe.com/cps/193/tn_19323.html
This is actually a combination of issues. The minor issue was that one application was interfering with Flex Builder Plug-in. The major issue had to do with a setting which had gotten changed on the Flash debugger.
If you right-click the running SWF and then click Debugger, you can (essencially) tell the VM where to listen for trace actions. This had been set to another machine on the network, and not my local machine. As soon as that was switched, everything restored itself.

Resources