Welcome! Log In Create A New Profile

Advanced

WM25 090F - Generation Error - "cannot find symbol"

Posted by PeHoBe 
WM25 090F - Generation Error - "cannot find symbol"
April 13, 2021 12:25PM
Hi,

Trying to generate an Android application but bumping into these generation errors.
It seems to be related to the Idx integer variable that is being used for most array operations within the class concerned.
(Point to "vWD_idx" in the log)

Anybody has an idea?

Quote
Log
Failure creating the Android application named .

Command line: "C:\Program Files\Java\jdk1.8.0_172\bin\java.exe" -Duser.dir="C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen" "-Dorg.gradle.appname=C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen" -classpath "C:\WX\WinDev25\Personal\Android\Gradle\lib\gradle-launcher-5.4.1.jar" org.gradle.launcher.GradleMain assembleRelease -b "C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\build.gradle"


Error returned:
:compileReleaseJavaWithJavac
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:4479: error: cannot find symbol
if(vWD_idx.opSup(0))
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:4482: error: cannot find symbol
vWD_JDEMO.setValeur(mWD_WXJDEMediaObjectList.checkType(GWDCoJDEMediaObjectList.class).mWD_list.get(vWD_idx));
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:4520: error: cannot find symbol
if(vWD_idx.opSup(0))
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:4523: error: cannot find symbol
mWD_WXJDEMediaObjectList.checkType(GWDCoJDEMediaObjectList.class).mWD_list.get(vWD_idx).setValeur(vWD_JDEMO);
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:4837: error: cannot find symbol
if(vWD_idx.opSup(0))
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:4840: error: cannot find symbol
vWD_JDEMO.setValeur(mWD_WXJDEMediaObjectList.checkType(GWDCoJDEMediaObjectList.class).mWD_list.get(vWD_idx));
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:4902: error: cannot find symbol
if(vWD_idx.opSup(0))
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:4905: error: cannot find symbol
mWD_WXJDEMediaObjectList.checkType(GWDCoJDEMediaObjectList.class).mWD_list.get(vWD_idx).setValeur(vWD_JDEMO);
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:5131: error: cannot find symbol
if(vWD_idx.opSup(0))
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:5134: error: cannot find symbol
vWD_JDEMO.setValeur(mWD_WXJDEMediaObjectList.checkType(GWDCoJDEMediaObjectList.class).mWD_list.get(vWD_idx));
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:5172: error: cannot find symbol
if(vWD_idx.opSup(0))
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:5175: error: cannot find symbol
mWD_WXJDEMediaObjectList.checkType(GWDCoJDEMediaObjectList.class).mWD_list.get(vWD_idx).setValeur(vWD_JDEMO);
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:5487: error: cannot find symbol
if(vWD_idx.opSup(0))
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:5490: error: cannot find symbol
vWD_JDEMO.setValeur(mWD_WXJDEMediaObjectList.checkType(GWDCoJDEMediaObjectList.class).mWD_list.get(vWD_idx));
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:5552: error: cannot find symbol
if(vWD_idx.opSup(0))
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
C:\WX Projects\My Projects\PIXJDEMobileOrchestration\Android\gen\src\eu\pixontri\pixjdemobileorchestration\wdgen\GWDCoJDEdwardsREST.java:5555: error: cannot find symbol
mWD_WXJDEMediaObjectList.checkType(GWDCoJDEMediaObjectList.class).mWD_list.get(vWD_idx).setValeur(vWD_JDEMO);
^
symbol: variable vWD_idx
location: class GWDCoJDEdwardsREST
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
16 errors

Task :compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
Compilation failed; see the compiler error output for details.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at [help.gradle.org]

BUILD FAILED in 59s
10 actionable tasks: 7 executed, 3 up-to-date

TIA

Peter Holemans



Edited 1 time(s). Last edit at 04/13/2021 12:28PM by PeHoBe.
SOLVED: WM25 090F - Generation Error - "cannot find symbol"
April 14, 2021 09:29AM
Hello

The issue has been identified and a service request has been raised: ST/G061174.
The problem is (although it makes perfect sense) that for Android generation you cannot use a variable that is declared in a conditional <COMPILE IF...> preprocessor block after it.
It seems there is a scoping translation issue during the transformation of the WL code to Java code upon generation when these conditional compilation preprocessor blocks are being used and variables are declared within.
All works fine in the simulator or on other platforms (Windows / Web / ...).

Sample code:

//### GENERATES ERRORS UPON GENERATION ###
//--> Try to generate an Android app with a variable declaration (Idx) in a preprocessor compilation block and use it the statements after.
//E.g.:
<COMPILE IF ConfigurationType=Android>
Idx is system int = WXJDEMediaObjectList.list.Seek(asLinearFirst,"moStructure;moKey;moSequence",pMOStructure,pMOKey,pMOSequence)
<ELSE>
Idx is system int = WXJDEMediaObjectList.list.Seek(tccIgnoreCase+tccIgnoreInsideSpace+tccIgnoreAccent+tccIgnoreSpace+asLinearFirst,"moStructure;moKey;moSequence",pMOStructure,pMOKey,pMOSequence)
<END>
IF Idx > 0 THEN
JDEMO = WXJDEMediaObjectList.list[Idx]
ELSE
JDEMO.moStructure = pMOStructure
JDEMO.moKey = pMOKey
JDEMO.moSequence = pMOSequence
JDEMO.moType = 0
END

//### DOESN'T GENERATE ERRORS UPON GENERATION ###
//Next move the declaration of the Idx variable outside of the block and notice how it generates correctly.
//E.g.

Idx is system int
<COMPILE IF ConfigurationType=Android>
Idx = WXJDEMediaObjectList.list.Seek(asLinearFirst,"moStructure;moKey;moSequence",pMOStructure,pMOKey,pMOSequence)
<ELSE>
Idx = WXJDEMediaObjectList.list.Seek(tccIgnoreCase+tccIgnoreInsideSpace+tccIgnoreAccent+tccIgnoreSpace+asLinearFirst,"moStructure;moKey;moSequence",pMOStructure,pMOKey,pMOSequence)
<END>
IF Idx > 0 THEN
JDEMO = WXJDEMediaObjectList.list[Idx]
ELSE
JDEMO.moStructure = pMOStructure
JDEMO.moKey = pMOKey
JDEMO.moSequence = pMOSequence
JDEMO.moType = 0
END
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: