snapcraft internal error: AttributeError("'list' object has no attribute 'get'")
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
### Bug Description
I am using snapcraft 8.13.0.post3 on Ubuntu 26.04 riscv64.
When trying to build a snap I get an error
```
snapcraft internal error: AttributeError("'list' object has no attribute 'get'")
```
Obviously the yaml file below has an incorrect platform specification. What I don't like is how errors are reported. My expectation is to get an error message explaining which field in the yaml file has a problem and a suggestion how to fix it. The best solution would be to compare snapcraft.yaml to a schema and indicate to the user where the schema is not matched.
### To Reproduce
Run snapcraft on the provided snapcraft.yaml.
### Environment
snapcraft 8.13.0.post3 on Ubuntu 26.04 riscv64
### snapcraft.yaml
```yaml
type: app
name: hello-rva23
base: core26
build-base: devel
version: '2.12'
summary: GNU Hello requiring RVA23S64 support
description: |
GNU hello prints a friendly greeting.
Since Ubuntu 25.10 support for RVA23S64 is required on the RISC-V
architecture. This also applies to all snaps built using core 26.04.
This instance of a hello snap has been specifically built with the
RVA23S64 requirement.
grade: devel
confinement: devmode
platforms:
riscv64:
- build-on: riscv64
build-for: riscv64
apps:
hello:
command: bin/hello
parts:
gnu-hello:
source: http://ftp.gnu.org/gnu/hello/hello-2.12.tar.gz
plugin: autotools
```
### Relevant log output
```shell
2025-10-29 11:44:22.288 Starting snapcraft, version 8.13.0.post3
2025-10-29 11:44:22.297 Log verbosity level set to BRIEF
2025-10-29 11:44:22.298 Setting up Project
2025-10-29 11:44:22.301 Project file found at '/home/ubuntu/hello-rva23/snapcraft.yaml'
2025-10-29 11:44:22.304 Loading project file 'snapcraft.yaml
2025-10-29 11:44:22.518 Preparing application...
2025-10-29 11:44:22.519 Setting up ConfigService
2025-10-29 11:44:23.294 Merging commands for group 'Lifecycle':
2025-10-29 11:44:23.305 - using application command for 'clean'.
2025-10-29 11:44:23.305 - using application command for 'pull'.
2025-10-29 11:44:23.305 - using application command for 'build'.
2025-10-29 11:44:23.305 - using application command for 'stage'.
2025-10-29 11:44:23.305 - using application command for 'prime'.
2025-10-29 11:44:23.306 - using application command for 'pack'.
2025-10-29 11:44:23.306 Merging commands for group 'Other':
2025-10-29 11:44:23.314 Running snapcraft without a command will not be possible in future releases. Use 'snapcraft pack' instead.
2025-10-29 11:44:23.316 Configuring application...
2025-10-29 11:44:23.766 Build plan: platform=None, build_for=None
2025-10-29 11:44:23.770 Loading project because a directory was not provided.
2025-10-29 11:44:23.775 snapcraft internal error: AttributeError("'list' object has no attribute 'get'")
2025-10-29 11:44:23.808 Traceback (most recent call last):
2025-10-29 11:44:23.808 File "/snap/snapcraft/16394/lib/python3.12/site-packages/craft_application/application.py", line 663, in run
2025-10-29 11:44:23.808 return_code = self._run_inner()
2025-10-29 11:44:23.808 ^^^^^^^^^^^^^^^^^
2025-10-29 11:44:23.809 File "/snap/snapcraft/16394/lib/python3.12/site-packages/snapcraft/application.py", line 183, in _run_inner
2025-10-29 11:44:23.809 return_code = super()._run_inner()
2025-10-29 11:44:23.809 ^^^^^^^^^^^^^^^^^^^^
2025-10-29 11:44:23.809 File "/snap/snapcraft/16394/lib/python3.12/site-packages/craft_application/application.py", line 630, in _run_inner
2025-10-29 11:44:23.809 project_service.configure(platform=platform, build_for=build_for)
2025-10-29 11:44:23.809 File "/snap/snapcraft/16394/lib/python3.12/site-packages/craft_application/services/project.py", line 83, in configure
2025-10-29 11:44:23.809 platforms = self.get_platforms()
2025-10-29 11:44:23.809 ^^^^^^^^^^^^^^^^^^^^
2025-10-29 11:44:23.809 File "/snap/snapcraft/16394/lib/python3.12/site-packages/craft_application/services/project.py", line 279, in get_platforms
2025-10-29 11:44:23.809 self.__platforms = self._preprocess_platforms(raw_project["platforms"])
2025-10-29 11:44:23.809 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-10-29 11:44:23.809 File "/snap/snapcraft/16394/lib/python3.12/site-packages/craft_application/services/project.py", line 253, in _preprocess_platforms
2025-10-29 11:44:23.809 cls._vectorise_platforms(platforms)
2025-10-29 11:44:23.809 File "/snap/snapcraft/16394/lib/python3.12/site-packages/craft_application/services/project.py", line 239, in _vectorise_platforms
2025-10-29 11:44:23.810 if data.get("build-for") is None and name in (
2025-10-29 11:44:23.810 ^^^^^^^^
2025-10-29 11:44:23.810 AttributeError: 'list' object has no attribute 'get'
2025-10-29 11:44:23.810 Full execution log: '/home/ubuntu/.local/state/snapcraft/log/snapcraft-20251029-114422.240439.log'
```
### Additional context
_No response_
Evaluation history
No evaluation history available.