Gradle Java sourceCompatibility set to 1.8, creating unresolved dependencies

Open Beginner friendly
#2,177 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
build-system

Research direction

Start by inspecting build.common.gradle and FtcRobotController/build.gradle, focusing on the Java sourceCompatibility and targetCompatibility settings shown in the issue. Check how those settings affect the reported java.lang.invoke.StringConcatFactory dependency error, then build the project with the relevant tools to confirm the unresolved-dependency error is resolved.

Written by the indexing model from the issue text.

Description

build.common.gradle and \FtcRobotController\build.gradle both set Java source compatibility to 1.8:

        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

This causes unresolved dependencies in some build tools, as the class files for Java 9+ cannot be loaded if the compiler runs with this compatibility level. Attempting to build the project anyway results in errors such as this:

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.invoke.StringConcatFactory. Fix the build path then try building this project

There may be other compatibility settings leading to build errors.

Dominant language
Java
Stars
1.3k
Forks
10k
Avg merge
18m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FIRST-Tech-Challenge/FtcRobotController

All issues in FIRST-Tech-Challenge/FtcRobotController

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.