Update 2017 r2.1 code to 2018 r4

Updating a working 2017 r2.1 project to 2018 r4, won’t allow it to run (grayed out). How do I begin to identify offending code segments?

Use BreakPoints in the code (App, then the default window)…

Use System.DebugLog.

What OS are-you using ?

What kind of project is it?

If the Run button is grayed out, make sure you still have a target selected in the Build Settings area of the Navigator.

@Paul:
A recent feature ?
(does not exists in Xojo 2015r1/El Capitan…)

[quote=422034:@Emile Schwarz]@Paul:
A recent feature ?
(does not exists in Xojo 2015r1/El Capitan…)[/quote]
this has been part of the Xojo IDE for many many years… if you don’t select at least one platform, you cannot “run” or “compile”

I have never seen the Run button grayed out, only the Build button (if I don’t have at least one check mark on build settings).

For Desktop I can confirm that 2018r4 allows you to run/debug with no platform selected.

FWIW the only time I’ve ever seen Run disabled was if there was a configuration settings problem with iOS projects.

I checked * before writing the answer (unchecking all OS and This computer), and click in the green button to run in the IDE and quit (without warning for the changes).

  • You will know in 10 or more years how to check everything because of memory malfunction (I wish you not know that, but at some age, the memory start to be lazy…)

[quote=422039:@Tim Parnell]For Desktop I can confirm that 2018r4 allows you to run/debug with no platform selected.

FWIW the only time I’ve ever seen Run disabled was if there was a configuration settings problem with iOS projects.[/quote]
Tim is right. I was thinking of the Build button.

Run can be disabled on iOS if Xcode is not installed or not been allowed to install its tools. I have no idea why Run would be disabled for Web/Desktop/Console projects.

Thanks all - sorry I was light on details there, but was starving and needed a sandwich ;-). Host is MacOS X Mojave, target is iPad Air 2/iOS 12.1 in the Simulator. I checked, was running xCode 10.1. However, I hadn’t cleared an older xcode-select command that was still pointing to xCode 7 for the Xojo 2017 r2.1 release, so fixed that.
Anyway, I can now Run, but the application runs and then bombs without any error indication or System.DebugLog. I suppose I can play the breakpoint game, but was hoping for a more elegant path to the problem.
Also, Build builds as well; dropping it onto a live device (iPad Mini 2) running iOS 12.1.1 also bombs* without indication.

  • bombs = app begins execution, brings up beginning of app, steps along fine, then returns to its initial state without any error indication.

http://documentation.xojo.com/index.php/System.DebugLog

Fire the console application and read the messages from there (?).

Thus the use of System.DebugLog (for example).

Ah, I get it - but I already had my own debug logging utility and the messages just stopped, so I need to add more clarity and density to the messages.
I’ve already singlestepped my way into oblivion - “What? Where’d it go?” - so I’ll need to dig further in the morning.

Hi guys, first of all excuse my english. In my case, updating from 2017r2 to 2018r4 was really a huge mess. A lot of exceptions which I’m trying to resolve for about two weeks and the worst, which happened today, one of the program features (implies another window) stopped working (application quit unexpectedly). I’ve set a breakpoint to catch the exception but app crashed before even show that window. I’ve tried to read the code in that window but it became completely inaccessible in Xojo IDE (probably a saving bug). Nothing happened when I was trying to select it and after that, every selection led to “no editor”.
So I had to remove the window, recreate it, run 2017r2 again and copy/paste every control, methods, properties etc from the older to latest version. Now it seems to be fine and I hope that this will be fixed in the future version.

I’m referring back to my previous issue - turns out that the 2018 r4 environment quits at the first ExecuteJavascript, using the same JS and Xojo code as was successful using 2017 r2.1.

Code runs successfully on 2017 r2.1

[quote=422667:@Michael Gehl]I’m referring back to my previous issue - turns out that the 2018 r4 environment quits at the first ExecuteJavascript, using the same JS and Xojo code as was successful using 2017 r2.1.

Code runs successfully on 2017 r2.1[/quote]
Assuming this is still your iOS project, 2018r4 updated the iOS SDK version to iOS 12 and HTMLViewer was updated to WKWebView in 2018r2. As there’s no ExecuteJavascript command available in the base control, I would bet that you’re used by a declare that’s no longer compatible and needs to be updated.

Inherited project, sorry - I have, for example,

EvaluateJavascript(extends web as iOSHTMLViewer, JS as Text) as Text
Declare Function stringByEvaluatingJavaScriptFromString Lib “UIKit” Selector “stringByEvaluatingJavaScriptFromString:” (id As Ptr, js As CFStringRef) As CFStringRef

Dim jsResponse As Text
jsResponse = stringByEvaluatingJavascriptFromString(web.Handle, JS)

Return jsResponse

[quote=422672:@Michael Gehl]Inherited project, sorry - I have, for example,

EvaluateJavascript(extends web as iOSHTMLViewer, JS as Text) as Text
Declare Function stringByEvaluatingJavaScriptFromString Lib “UIKit” Selector “stringByEvaluatingJavaScriptFromString:” (id As Ptr, js As CFStringRef) As CFStringRef

Dim jsResponse As Text
jsResponse = stringByEvaluatingJavascriptFromString(web.Handle, JS)

Return jsResponse[/quote]
Right. That method is from UIWebView and doesn’t work with WKWebView. See the following link for more info:

https://developer.apple.com/documentation/uikit/uiwebview/1617963-stringbyevaluatingjavascriptfrom?language=occ

Would anyone have an example using WKWebView?

Would anyone have an example using WKWebView using Xojo syntax? I am obviously not Obj-C adept…