Import Errors on Raspberry Pi Code

When trying to build code for the Raspberry Pi on our team laptops, we receive a bunch of errors related to imports that cannot be resolved (e.g. .edu, com.google, etc.)*. While we don’t receive these errors on one of our student laptops, we’re admittedly baffled as to the process we went through in the early season to achieve this functionality. Any and all advice is welcome - thank you in advance from 386!

*The team laptops have been and are able to build standard robot code.

can you post the code, the errors that you receive and the programming language you use?
That will certainly help diagnose the problem.

The code is the default java-multiCameraServer example from the pi dashboard, the language is java, and the errors consist of ‘import cannot be resolved’; if it would help, I can post a fuller report, but there’s not much beyond that.

I am not a Java expert and I don’t use Java in FRC so I am not familiar with the default java-multiCameraServer example. I may be able to help you if I can see the code but maybe someone who is more familiar with Java can help more.

Where do you get these errors from? Eclipse? Other editor? When packaging the jar through terminal/cmd?

Also, did it ever work in the past for you? (As in, is this a new error when it worked before?)

com.google appears very surprising to me as I don’t think Google really has anything to do with opencv/cscore libraries, could you please provide the exact print out errors?

Could you elaborate on the differences in setup between those two computers? Is the editor/compiler installed in the same way for both of them? Do you have admin privileges on the team laptop (may not be the case for a school laptop)?

  1. We’re working in VSCode.

  2. These errors have consistently appeared on all laptops except the one personal laptop the student has. Code will compile with no errors and build on this laptop, and show errors on any other laptop.

  3. Exact error printouts are as follows:

    a. This is the first error in the ‘Problems’ tab

    Could not run build action using Gradle distribution
    https://services.gradle.org/distributions/gradle-5.0-bin.zip’. A problem occured
    configuring root project ‘java-multiCameraServer’. Could not resolve all artefacts for
    configuration ‘:classpath’. Could not resolve org.jdom.jdom2:2.0.6. Required by:
    project : >
    com.github.johnrengalman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins.:shadow:4.0.3
    Could not resolve org.jdom:jdom2:2.0.6.
    Could not get resource ‘https://plugins.gradle.org/m2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.pom’.
    Could not GET ‘https://plugins.gradle.org/m2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.pom’.
    plugins.gradle.org

b. The rest of the errors in ‘Problems’ follow this format
The import com.google cannot be resolved
The import edu cannot be resolved
The import org.opencv cannot be resolved
And all the problems that come from faulty imports, like types
not being resolved

c. This is the error we receive when attempting to build
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘java-multiCameraServer’.

Could not resolve all artifacts for configuration ‘:classpath’.
Could not resolve org.jdom:jdom2:2.0.6.
Required by:
project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins:shadow:4.0.3
Could not resolve org.jdom:jdom2:2.0.6.
Could not get resource ‘https://plugins.gradle.org/m2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.pom’.
Could not GET ‘https://plugins.gradle.org/m2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.pom’.
plugins.gradle.org
Could not resolve org.ow2.asm:asm:7.0-beta.
Required by:
project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins:shadow:4.0.3
Could not resolve org.ow2.asm:asm:7.0-beta.
Could not get resource ‘https://plugins.gradle.org/m2/org/ow2/asm/asm/7.0-beta/asm-7.0-beta.pom’.
Could not GET ‘https://plugins.gradle.org/m2/org/ow2/asm/asm/7.0-beta/asm-7.0-beta.pom’.
plugins.gradle.org
Could not resolve org.ow2.asm:asm-commons:7.0-beta.
Required by:
project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins:shadow:4.0.3
Could not resolve org.ow2.asm:asm-commons:7.0-beta.
Could not get resource ‘https://plugins.gradle.org/m2/org/ow2/asm/asm-commons/7.0-beta/asm-commons-7.0-beta.pom’.
Could not GET ‘https://plugins.gradle.org/m2/org/ow2/asm/asm-commons/7.0-beta/asm-commons-7.0-beta.pom’.
plugins.gradle.org
Could not resolve commons-io:commons-io:2.5.
Required by:
project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins:shadow:4.0.3
Could not resolve commons-io:commons-io:2.5.
Could not get resource ‘https://plugins.gradle.org/m2/commons-io/commons-io/2.5/commons-io-2.5.pom’.
Could not GET ‘https://plugins.gradle.org/m2/commons-io/commons-io/2.5/commons-io-2.5.pom’.
plugins.gradle.org
Could not resolve org.apache.ant:ant:1.9.7.
Required by:
project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins:shadow:4.0.3
Could not resolve org.apache.ant:ant:1.9.7.
Could not get resource ‘https://plugins.gradle.org/m2/org/apache/ant/ant/1.9.7/ant-1.9.7.pom’.
Could not GET ‘https://plugins.gradle.org/m2/org/apache/ant/ant/1.9.7/ant-1.9.7.pom’.
plugins.gradle.org
Could not resolve org.codehaus.plexus:plexus-utils:3.0.24.
Required by:
project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins:shadow:4.0.3
Could not resolve org.codehaus.plexus:plexus-utils:3.0.24.
Could not get resource ‘https://plugins.gradle.org/m2/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.pom’.
Could not GET ‘https://plugins.gradle.org/m2/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.pom’.
plugins.gradle.org
Could not resolve org.apache.logging.log4j:log4j-core:2.11.0.
Required by:
project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins:shadow:4.0.3
Could not resolve org.apache.logging.log4j:log4j-core:2.11.0.
Could not get resource ‘https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-core/2.11.0/log4j-core-2.11.0.pom’.
Could not GET ‘https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-core/2.11.0/log4j-core-2.11.0.pom’.
plugins.gradle.org
Could not resolve org.vafer:jdependency:2.1.1.
Required by:
project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:4.0.3 > com.github.jengelman.gradle.plugins:shadow:4.0.3
Could not resolve org.vafer:jdependency:2.1.1.
Could not get resource ‘https://plugins.gradle.org/m2/org/vafer/jdependency/2.1.1/jdependency-2.1.1.pom’.
Could not GET ‘https://plugins.gradle.org/m2/org/vafer/jdependency/2.1.1/jdependency-2.1.1.pom’.
plugins.gradle.org

  1. Our team laptops are configured specifically to act as driver stations. Personal laptops are the students’ own computers. The editor is installed the same way on both computers.

Just a thought, are the computers connected to an internet connection? If so, is there a firewall on the network?—try to open the following link in a web browser and see if it downloads a file. (Since the editor is saying that it is unable to download from that link/resource).

In addition, could you include your code? Either a link to GitHub or a zip/folder with the files would work.

What does this mean in terms of the laptop? Is the user running an Administrator? Is there any school software running/configured on the computer?

You need an internet connection the first time you build the code on a computer so the dependencies can be downloaded and cached. Unlike wpilib there isn’t an offline installer so it’s necessary to do this step with an internet connection.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.