AL icon indicating copy to clipboard operation
AL copied to clipboard

directory.app.props.json and AL1022: A package could not be found in the package cache folders error

Open RadoArvay opened this issue 2 months ago • 1 comments

Usage of directory.app.props.json produces AL1022 error: A package with publisher 'P', name 'A', and a version compatible with '27.0.0.0' could not be found in the package cache folders: c:\PRJ\B../.alpackages

1. Describe the bug I will try to describe a situation - it is sort of complex and unclear.

There is a multiroot workspace with folders (apps) A and B. B depends on A. The workspace uses a configuration like

		"al.packageCachePath": "../.alpackages",
		"al.compilationOptions": {
			"outFolder": "../.albuilds"
		}

When standard app.json files are used, everthing works. Let's assume that both packages folders are always clear (no A or B app file is there). Then it does not matter which app is compiled the first (A or B), both can be compiled successfully. The output is like (when B was 1st?):

.alpackages
    P_A_27.0.0.0.app
.albuilds
    P_A_27.0.0.0.app
    P_B_27.0.0.0.dep.app
    P_B_27.0.0.0.app

When I prepare directory.app.props.json and it is placed to the workspace root and app.json of A and B apps are updated (I moved most of possible properties into directory.app.props.json), compilation (even pre-compiler) of apps becomes weird. Again, let's assume that both packages folders are always clear. And everytime I reload VSC.

Situation 1. When I open B app file (for example app.json), there is AL1022 pre-compiler error already there. But when I run app building, the app is created and output folders contains:

.alpackages
    P_A_27.0.0.0.app
.albuilds
    P_B_27.0.0.0.app

But I think it is possible only because of symbol downloading during the building - there is info in the output window: [2025-10-19 18:54:39.71] Sending request to http://test:7049/BC/dev/packages?publisher=P&appName=A&versionText=27.0.0.0&appId=xxxxxxxxx&tenant=default [2025-10-19 18:54:40.88] All reference symbols have been downloaded.

Next, A app can be also built and 1 file is placed to:

.albuilds
    P_A_27.0.0.0.app

Situation 2. When I open A app file, there is no error (no dependency). When I run app building, the app is created and output folders contains:

.albuilds
    P_A_27.0.0.0.app

After that, I open B app file. Pre-compiler shows AL1022 error but after a refresh (click out and back) disappears. But, the build is unsuccessful with AL1022 error. The only option is to download symbols or placed A.app file to package cache folder manually and after that to build the app.

NOTE: Neither Situation 1 nor 2 produces dep.app file.

2. To Reproduce Most of information is in the Description above. Example of directory.app.props.json:

{
    "variables": {
        "publisher": "P",
        "major": "27",
        "minor": "0",
        "build": "0",
        "hotfix": "0",
        "version": "$(major).$(minor).$(build).$(hotfix)"
    },
    "properties": {
        "publisher": "$(publisher)",
        "version": "$(version)",
        "privacyStatement": "",
        "EULA": "",
        "help": "",
        "url": "",
        "logo": "./app-logo.png",
        "platform": "$(major).$(minor).0.0",
        "application": "$(major).$(minor).0.0",
        "runtime": "16.0",
        "target": "Cloud"
    }
}

...and all properties are removed from app.json.

3. Expected behavior

4. Actual behavior

5. Versions:

  • AL Language: 16.1.1860725
  • Visual Studio Code: 1.105.1

Internal work item: AB#611576

RadoArvay avatar Oct 19 '25 19:10 RadoArvay

Note from another testing: when I direct packages configuration to one folder, for example:

"al.packageCachePath": "../.alpackages",
"al.compilationOptions": {
    "outFolder": "../.alpackages"
}

then "Situation 2" is eliminated - not fully, there is still necessary to refresh/reload VSC, but.....

RadoArvay avatar Oct 20 '25 06:10 RadoArvay