Newbie cannot properly run or debug fresh project using Gluon multi-view with FXML in IntelliJ - intellij-idea

I created a brand new Gluon mobile multi view with FXML project in IntelliJ CE 2018.2.1 using the Gluon plugin version 2.7.0 and Gradle 4.10.1
I open the Gradle tool window, Pick Project(root), Tasks, Application, run and I do see the generated application run properly, I believe, though it defaults to a mobile device sized window.
I get this error message:
SEVERE: javafx.platform is not defined. Desktop will be assumed by default.
What I'd like to do is debug a single JavaFX program in IntelliJ for all of the supported platforms (except embedded) in Windows and see more or less the right screen sizes before I start plugging in my iPad/iPhone/Android phone/Android tablet/Mac just to get the code logic right.
Is there some setting that would let me switch between simulating different devices as a first stage?
When I double click "debug" I get the following message and the window hangs.
Listening for transport dt_socket at address: 5005
Is this related? Are we trying to debug an actual device by accident?

As for the app size, when you run on desktop it defaults to a phone form factor of 335x600. This comes from the Display service:
#Override
public Dimension2D getDefaultDimensions() {
return isTablet() ? new Dimension2D(900, 600) : new Dimension2D(335, 600);
}
You can change to a tablet format of 900 x 600 if you set the charm-desktop-form system property to tablet.
Or you can simply override these settings, and set your desired size:
#Override
public void postInit(Scene scene) {
Swatch.BLUE.assignTo(scene);
if (Platform.isDesktop()) {
((Stage) scene.getWindow()).setWidth(400);
((Stage) scene.getWindow()).setHeight(800);
}
}
When you deploy your app to a mobile device, it will just adjust to the size of its screen.
Related to the message javafx.platform is not defined running on desktop, that system property is not defined, so it is a warning message that informs that desktop is selected. When you run on mobile, the proper Android or iOS value will be set for the platform.
Finally, about debugging, when you run on desktop you initially can debug only the desktop application, but you can modify the size of the application as mentioned above.
To debug the mobile application, you have to run either the iOS simulator or the Android emulator.
This question shows how to debug on Android from IntelliJ, but you have to actually deploy the application to a mobile device.
On iOS, providing you have a Mac, you can use the launchIPhoneSimulator task to launch the iOS simulator, where you can choose any of the possible iPhone or iPad devices with their different screens resolutions. In this case you don't need a device.

Solution to part 2: Debug the Desktop version from inside IntelliJ.
In IntelliJ, make a new Run configuration of type Gradle and use "run" not "debug" as the "task". Then choose "backpack [run]" from the toolbar and use the "debug" icon on the toolbar. IntelliJ will run the app with the JDWP options enabled and connect the debugger to it.

Related

Why does running UIAutomation methods from KIF result in: "UIAutomation is not enabled on this device. UIAutomation must be enabled in Settings"?

Using:
iOS 8.4, XCode 6.4, KIF 3.2.1 (https://github.com/kif-framework/KIF)
I encounter the following problem on a real device:
While running a KIF test case, calling the method, "deactivateAppForDuration" results in the following output seen in the XCode console: "UIAutomation is not enabled on this device. UIAutomation must be enabled in Settings."
On the simulator, the app does indeed go to the background for the duration specified in the parameter of that method call.
I can confirm that the setting in device settings, "Developer >
UIAutomation" is toggled on.
The build that I am compiling and running is a Debug build and is
signed with my Developer Provisioning Profile (not a distribution
profile).
All the possible compile configurations in the scheme are
set to debug (profile for example)
I can record and playback UI interactions in the instruments
developer tool (confirms that the app is built right and that the
phone settings are correct)
Specific Code:
[tester deactivateAppForDuration:5];
What could I be missing?
This is a known issue with UIAutomation on the device, see here.

App crashing on launch with instrumentation w/ calabash-ios

UPDATE: This was fixed by resetting the phone's settings. General -> Reset -> "Reset all settings".
We are having on issue on iPhones 6 and 6+ when launching our IBM MobileFirst-based app.
When calabash instrumentation is linked and I manually launch the app, the splash screen will come up and the app will quit almost instantly.
Double tapping home shows me the app running in the background, but Xcode does not recognize it as a running process. After force-closing the app and re-launching, it will usually do the same thing, but sometimes it comes up.
I've noticed our automation is sometimes stuck in an infinite loop of launching and crashing. This only happens on the instrumented app.
The crash log throws EXC_BAD_ACCESS. I found a thread on the google group from a few years back that talks about linker flags, but I don't have any of the weaker flags mentioned there.
Steps to reproduce:
*App must be instrumented with the calabash automation framework (calabash-ios setup must have been executed in same directory as xcodeproj file.)
Build application and deploy native iOS project to XCode via eclipse.
Build the -cal target with the "Run" configuration.
Kill the debugger/application.
Manually launch the app on the device. The app will successfully launch maybe 15%-20% of the time, otherwise it will just quit.
Using calabash-cucumber version 0.14.3.
Linker flags:
$(inherited)
-force_load
"$(SRCROOT)/calabash.framework/calabash"
-lstdc++
It appears $(inherited) contains -ObjC for Debug.
Xcode installed at: /Applications/Xcode.app/Contents/Developer
Xcode version: 6.1.1
Xcode build: 6A2008a
The user is unresponsive, the fix was:
Actually I just found the fix to this. What I had to do is reset the
phone's settings in Settings -> General -> Reset -> "Reset All
Settings" (the first option). Have not seen the behavior since.
I had exact same problem, tried so many different ways and finally found how to fix it - I changed project directory, pulled from Git, then bundle install, pod install and build the app with calabash target as usual
Xcode 7.3.1, calabash-cucumber (0.19.1)

ERROR : Invalid "--device-id"

I am facing a problem while running my app from titanium studio. my previous app was running properly but i created new project and then when i try to run my app, it says
[ERROR] : Invalid "--device-id" value "AVD"
For help, run: titanium help build
[ERROR] Application Installer abnormal process termination. Process exit value was 1
here AVD is my android virtual device name. my device is running properly.
Possible reasons and solutions
Bug in the Android SDK
There was a bug in the Android SDK which is already fixed. The fix was released with Android SDK-Tools 22.6.2. Here are some more information from the Appcelerator Bugtracker.
The (real) device doesn't trust your computer
The USB-Debugging is active on you device, so It is displayed in the device list, but the device doesn't trust your computer. To fix that unplug the device and plug It again. Wait for the trust this computer dialog and click ok.
Corrupted / Wrong "run config"
Sometimes it happens that the run configurations gets corrupted or you have added a wrong one. In this case you can delete the configuration under "Run Configuration":
Click the arrow with the current device
Click on "Run Configuration"
Select the not working configuration (e.g. under Titanium Android Emulator)
Click on the red "X" Close the dialog
and "run" the device again

onResume not working for android launchMode standard in Worklight project

Worklight 5.0.5
Android - 4.1
I have been working to merge a native and hybrid code base into a single worklight application. As part of that I have updated my launcher activity launchMode to 'standard' so that when the app is resumed it restores to either the correct webview or to another activity based on last activity the user was viewing. (worklight default projects are set to 'singleTask')
This configuration works fine when building from eclipse directly onto he device. When I create a signed APK copy to the device and install I get different behavior for the resume lifecycle. Here are the steps that create the error
Start App
Change the state of the app
Press Home button
Open application folder
Click app icon
RESULT - App runs onCreate rather than onResume
What is strange is that if I do a long press on home, and choose my app from recently used it resumes as normal. (why would they be different?)
I recently upgraded to 5.0.5 and have only now noticed the issue. Perhaps its related to the new phonegap version?
The issue is easy to recreate with a new Worklight project.
Use the new project wizard with no framework.
Modify your android activity
activity android:name=".SimpleWorklight"
android:label="#string/app_name"
android:configChanges="orientation|keyboardHidden"
android:launchMode="standard"
Update the markup so that you can change its state to prove an onCreate, vs on onResume
<input type="submit" onclick="buttonClick()">
<span id=label>SimpleWorklight</span>
var counter=1;
function buttonClick(){
document.getElementById("label").innerText="Clicked"+counter;
counter=counter+1;
}
It is reasonably similar to this
https://groups.google.com/forum/?fromgroups=#!topic/android-developers/UjWcsFMe6ik
UPDATE - I attempted the same test and got the same result running with 5.0.2.407-developer-edition
Aaron Allsbrook
I resolved this issue, it appears to be a possible bug in android (or maybe just the way android behaves) When you launch from the app icon it basically always starts a new activity on top of the existing one if it was there already. There are a couple of possible solutions mentioned here.
http://code.google.com/p/android/issues/detail?id=2373
I first tried the simpliest approach of adding to the onCreate method
if (!isTaskRoot()) {
finish();
return;
}
but this returned NPEs back from the cordovawebview library. Rather than trying to debug through Worklight and into Cordova I tried the solution found here https://github.com/cleverua/android_startup_activity
Where you create a startup android activity that will look at all the running tasks. If it finds the task running it will simply close the new activity and fall back to the running one. If it doesnt find the task running it will create the new intent and transition over.

Can't find IPhone IOS Platform when creating a new flex mobile project

I am trying to create a new Flex Mobile project that runs on the IOS platform, using Flash Builder 4.5. After specifying the project name, The wizards opens the Mobile Settings form, where I am supposed to choose between two platforms, Google Android and IOS. Only Google Android is appearing in the Platform Drop down list, What could be the problem? I am running a newly installed version of Flash Builder 4.5
Thanks
You need to update to Flash Builder 4.5.1, download an updater from here.
To configure your iOS platform, follow these instructions:
press Run-> Debug config
display your mobile app in left side
Then choose your target platform in right side of this config window.
Next choose your Launch method:
iPad
iPhone4
iPod
To Run configure your target platform in flash builder
follow these instructions:
* press Run-> Debug config
* display your mobile app in left side
then
choose your target platform in right side of this config window.
if u choose ios platform to 1. iPad 2. iPhone4 3. iPod lunch method drop down list
Next choose any one your Launch method
Here's an Article on how to configure Flash Builder for iOS Development from A-Z:
Configuring Flash Builder 4 for iPhone/iPad iOS Development