I'm trying to work with Excel in my project, so I added few additional jar's to it:
MyBuildPath
When I'm trying to run my project, I'm getting such exceptions:
:compileJavaC:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:12: error: package org.apache.poi.ss.usermodel does not exist
import org.apache.poi.ss.usermodel.*;
^
C:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:13: error: package org.apache.poi.xssf.usermodel does not exist
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
.......
C:\Users\Azimut\Documents\workspaces\helperandroid\MultiViewProjectFXML\src\main\java\myClasses\SearchOrders.java:116: error: cannot find symbol
public static String getCellText(Cell cell) {
^
symbol: class Cell
location: class SearchOrders
13 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> 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.
BUILD FAILED
I searched a lot through the internet, but I still can't understand how to solve this problem.
I assume you are excuting your code commandline, and not using eclipse.
In that case, You will have to add dependency jars in class path when you run the code.
java -cp <jar files> is the possible way.
Are you able to execute in eclipse ?
Regards,
~KD
Related
I am just trying to follow the gradle tutorial to build a scala project https://docs.gradle.org/current/samples/sample_building_scala_applications.html.
However, I am facing the following error when I give the gradle commands "jar", "build" and "run":
Task :app:compileScala FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileScala'.
Could not resolve all files for configuration ':app:compileClasspath'.
Could not resolve org.scala-lang:scala-library:2.13.6.
Required by:
project :app
Could not resolve org.scala-lang:scala-library:2.13.6.
Could not get resource 'https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.pom'.
Could not GET 'https://repo.maven.apache.org/maven2/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.pom'.
Connection reset
Could not resolve com.google.guava:guava:30.1.1-jre.
Required by:
project :app
Could not resolve com.google.guava:guava:30.1.1-jre.
Could not get resource 'https://repo.maven.apache.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.pom'.
Could not GET 'https://repo.maven.apache.org/maven2/com/google/guava/guava/30.1.1-jre/guava-30.1.1-jre.pom'.
Connection reset
* 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 https://help.gradle.org
BUILD FAILED in 8s
1 actionable task: 1 executed
Does someone know how to solve it? My main goal is to generate a jar file of the project.
On Github while working with my friend on some code (actually experimental malware for pentesting), we set up a Gradle check, and it failed. When it ran, it said this:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'wurstplus-two'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
Required by:
project :
> Could not resolve net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT.
> Unable to load Maven meta-data from http://repo.spongepowered.org/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml.
> Could not get resource 'http://repo.spongepowered.org/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'.
> Could not GET 'http://repo.spongepowered.org/maven/net/minecraftforge/gradle/ForgeGradle/2.3-SNAPSHOT/maven-metadata.xml'. Received status code 520 from server: Origin Error
> Could not resolve org.spongepowered:mixingradle:0.4-SNAPSHOT.
Required by:
project :
> Skipped due to earlier error
* 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 https://help.gradle.org
BUILD FAILED in 11s
Error: Process completed with exit code 1.
I know we added some files, so I was thinking that might be what happened. I don't know any Gradle, so that's really why I'm asking.
There's actually 2 questions: What does "exit code 1" mean, and was it triggered by those new files being added? The Github repository is here: https://github.com/Scottw1e/wurstplus-two.
try replacing http://repo.spongepowered.org/maven/ with https://repo.spongepowered.org/maven/ in your build.gradle file
[Fatal Error] checker-qual-2.5.2.pom:2:1: Content is not allowed in prolog.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve org.checkerframework:checker-qual:2.5.2.
Required by:
project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.analytics-library:crash:26.5.0 > com.google.guava:guava:27.0.1-jre
Could not resolve org.checkerframework:checker-qual:2.5.2.
Could not parse POM https://jcenter.bintray.com/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.pom
Content is not allowed in prolog.
Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
Required by:
project : > com.android.tools.build:gradle:3.5.0 > com.android.tools.build:builder:3.5.0 > com.android.tools:sdklib:26.5.0 > com.android.tools:repository:26.5.0
Could not resolve org.glassfish.jaxb:jaxb-runtime:2.2.11.
Could not parse POM https://jcenter.bintray.com/org/glassfish/jaxb/jaxb-runtime/2.2.11/jaxb-runtime-2.2.11.pom
Could not resolve com.sun.xml.bind.mvn:jaxb-runtime-parent:2.2.11.
Could not resolve com.sun.xml.bind.mvn:jaxb-runtime-parent:2.2.11.
Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-runtime-parent/2.2.11/jaxb-runtime-parent-2.2.11.pom
Could not resolve com.sun.xml.bind.mvn:jaxb-parent:2.2.11.
Could not resolve com.sun.xml.bind.mvn:jaxb-parent:2.2.11.
Could not parse POM https://jcenter.bintray.com/com/sun/xml/bind/mvn/jaxb-parent/2.2.11/jaxb-parent-2.2.11.pom
Resetting to invalid mark
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 https://help.gradle.org
BUILD FAILED in 44s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I had this same problem once. I found the problem was because of my firewall. I disabled the firewall for a while to run my app and it worked fine. After that, I added Android Studio to my firewall whitelist.
If the firewall is causing you the problem, disable the firewall and try to run it again. If it works, add Android Studio to the firewall whitelist.
Hope it helps :)
EDIT:
Since the above solution is not working, delete all the contents of the following directories after closing Android Studio:
C:\Users\username\.gradle\caches
C:\Users\username\.android\build-cache
C:\Users\username\.android\cache
What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve project :path_provider_macos.
Required by:
project :app > project :path_provider
Unable to find a matching configuration of project :path_provider_macos: None of the consumable configurations have attributes.
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 https://help.gradle.org
BUILD FAILED in 2s
Finished with error: Gradle task assembleDebug failed with exit code 1
Some imports are missing. Try flutter pub get to update packages, or flutter pub cache repair, which will re-import all dependencies.
thank everyone , i get the solution about my problem : go to your Flutter sdk folder ,then go to .pub-cache\hosted\pub.dartlang.org\ ,if there have a path_provider_macos-0.0.4 folder ,delete it ,if no ,you try go .pub-cache\hosted\pub.flutter-io.cn\ , and remove path_provider_macos-0.0.4 folder
Deleted the folder you said,but show this wrong : Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_macos.
The following is detailed:
> A problem occurred configuring project ':flutter'.
> Could not resolve all dependencies for configuration ':flutter:embed'.
> Could not resolve project :path_provider_macos.
Required by:
project :flutter
> Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_macos.
> Could not resolve project :path_provider_linux.
Required by:
project :flutter
> Project :flutter declares a dependency from configuration 'embed' to configuration 'default' which is not declared in the descriptor for project :path_provider_linux.
I've got problems at building the OpenIAB unity package.
The sdk.dir is already set in the local.properties file.
This is the log:
Denniss-MBP:unity_plugin dennisxxx$ ../gradlew clean buildPlugin --info
Starting Build
Settings evaluated using settings file '/Volumes/Daten HDD/Downloads/OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62/settings.gradle'.
Projects loaded. Root project using build file '/Volumes/Daten HDD/Downloads/OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62/build.gradle'.
Included projects: [root project 'OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62', project ':Unity Plugin', project ':library']
Evaluating root project 'OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62' using build file '/Volumes/Daten HDD/Downloads/OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62/build.gradle'.
Evaluating project ':Unity Plugin' using build file '/Volumes/Daten HDD/Downloads/OpenIAB-Unity-Plugin-446cc2f310a2b13bcfdb93cf92ac5f9128d51f62/unity_plugin/build.gradle'.
Evaluating project ':library' using empty build file.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Unity Plugin'.
> Configuration with name 'default' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 4.414 secs
Denniss-MBP:unity_plugin dennisxxx$
What can I do to fix this issue?