Errors running builder 'Maven Project Builder' on project - eclipse-plugin

While maven installation, Errors running builder 'Maven Project Builder' on project 'com.oracle.oats'.
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6

I find the solution in many ways.
This is proxy error. you check access in proxy URL (host) in IE. (Open IE ->TOOL ->INTERNET OPTIONS -> CONNECTIONS -> LAN CONNECTION.)
If it is ok this is working fine.
Otherwise you remove maven-resources-plugin:jar:2.6. Re-execute.
You change eclipse-version.
If any other alternate solution. kindly update

Related

IntelliJ Tomcat Automatic Redeploy when running a gradle task

What I am trying to accomplish:
I want the tomcat 9 server to execute an automatic redeploy when I run a Gradle task that updates my HTML files.
This is my setup:
I use IntelliJ 2020.03 (ultimate edition), tomcat 9, the application is a GWT application.
My Configuration for Tomcat:
This is what I see when I hit the "Configure ..." button next to the line labeled "Application server:"
This is my Gradle task I run but tomcat does not automatically redeploy the changes
Things I already tried:
According to [https://www.jetbrains.com/help/idea/updating-applications-on-application-servers.html] I should have an option to "Update resources". But my options are limited to:
Therefore I assume I need to have "Exploded artifacts in local application server run configurations".
Therefore I headed to Tomcat -> Edit Configuration
I replaced the deploy to the exploded artifact:
Using this I get the following error message on starting up tomcat:
[2021-02-12 08:46:05,533] Artifact Gradle : NewComApp.war (exploded): com.intellij.javaee.oss.admin.jmx.JmxAdminException: com.intellij.execution.ExecutionException: C:\Users\heckner\IdeaProjects\NewComApp\build\libs\exploded\NewComApp.war not found for the web module.
So I decided to compare the artifact that "works" (but does not update the HTML files) with the "exploded" artifact which would be probably the right one but throws an error message on startup of tomcat.
This is the one which works ("NewComWar.war"):
This is the one which does throw an error message on startup ("NewComApp.war (exploded)":
As you can see in the image under "... which works". the war already seems to be "exploded". So why does IntelliJ does not offer the "update resources"?
But never the less, when I switch in Tomcat Edition to "NewCompApp.war (exploded)" i am able to select "update resources" in the drop down:
So probably this would be the way to go.
It obviously boils down to the point: What is wrong with the artifact declaration above so that tomcat throws the error message?
The feedback was: "ctually "NewComWar.war" is an archive that contains exploded artifact, that's why only "Redeploy" is possible. Please check that exploded artifact is created in "Output directory". "
Now the question is how I can add the exploded war to the Output Directory?
I tried:
but then I can only select from:
When I add this, it looks like this:
When I run Tomcat, it still says:
[2021-02-12 12:24:54,224] Artifact Gradle : NewComApp.war (exploded): com.intellij.javaee.oss.admin.jmx.JmxAdminException: com.intellij.execution.ExecutionException: C:\Users\heckner\IdeaProjects\NewComApp\build\libs\exploded\NewComApp.war not found for the web module.
Now I found the following tip (thanks Evgeny):
https://youtrack.jetbrains.com/issue/IDEA-178450#focus=streamItem-27-4068591.0-0
I switched under Settings -> Build, Execution, Deployment -> Build Tools -> Gradle: "Build and Run:" IntelliJ IDEA
I added this snipped to build.gradle:
task explodedWar(type: Copy) {
into "$buildDir/libs/exploded/${war.archiveFileName.get()}"
with war
}
war.dependsOn explodedWar
I switched the artifact which is deployed to the tomcat to
this automatically added the Gradle task:
Build 'Gradle:NewComApp.war (exploded) artifact to the
which is defined like this:
This accomplishes two things:
I can choose "Update resources" on my Edit Configuration for Tomcat like shown below:
My deployment runs well under tomcat
But ... :-)
Updates to the HTML files (within the war file) are not exploded to the NewComWar.war directory.
When I start tomcat I see the following file structure under C:\users<myname>\IdeaProjects\NewComApp\Libs\
The reason for this is that we use a Gradle task that generates the HTML files.
This task is called "copyHTML"
Under build.gradle it is defined now as follows:
war {
from 'war'
dependsOn copyHtml
exclude excludeInWar
doFirst {
manifest {
def version = ant.hasProperty('gitversion') ? ant.gitversion : 'undefined version'
println "Version: ${version}"
attributes("Implementation-Title": project.name, "Implementation-Version": version, "Built-By": new Date())
}
}
}
task explodedWar(type: Copy) {
into "$buildDir/libs/exploded/${war.archiveFileName.get()}"
with war
}
war.dependsOn explodedWar
copyHtml {
dependsOn generatorClasses
inputs.dir 'html'
inputs.dir 'email'
inputs.dir 'email.Tags'
inputs.dir props.getProperty('generator.htmlfiles.prefix') + 'html'
inputs.dir props.getProperty('generator.htmlfiles.prefix') + 'html.MeetingApp'
inputs.dir props.getProperty('generator.htmlfiles.prefix') + 'staticHtml'
inputs.properties props
outputs.dirs 'war', 'resources/com/newcomapp/server/mail'
doFirst {
ant.properties["generator.classpath"] = sourceSets.generator.runtimeClasspath.getAsPath()
}
}
task warWithoutGwt(type: War, dependsOn: war) {
}
gradle.taskGraph.whenReady { graph ->
if (graph.hasTask(warWithoutGwt)) {
compileGwt.enabled = false
}
}
When I run the Gradle task "warWithoutGWT" while tomcat still runs it says:
C:\Users<myname>\IdeaProjects\NewComApp\build\libs\exploded\NewComApp.war\WEB-INF\classes\com\newcomapp\server\integration\GeoLite2-Country.mmdb (The operation is not applicable to a file with an open area assigned to a user)
I assume that tomcat still holds a reference to that file, and the Gradle task tries to overwrite it (although there was no change to that file). Furthermore, I assume that this kills the rest of the Gradle task so that it does not update the HTML files (it's only an assumption though). How can I arrange an exploded war so that write-protected files are omitted and do not kill the rest of the Gradle task execution?
My answer up to now for this problem is: I changed the gradle script:
task explodedWar(type: Copy) {
into "$buildDir/libs/exploded/${war.archiveFileName.get()}"
exclude "**/*.mmdb"
with war
}
war.dependsOn explodedWar
so I added an "exclude for mmdb files". And this really works.
Is this a correct and good solution or do I overlook something? The reason I am asking is that changing HTML files in the scope of tomcat should be something very common with tomcat based projects. So I wonder if there is a more standardized, easier solution to this? It seems quite clumsy to copy and explode with additional gradle tasks the war file instead of IDEA take care of this.

Could not find com.google.gms:google-services:9.0,0

The Sync failed when tried to add the dependency for google play service. The problem seem to its looking for the jar in C:/Program/Files/Android/Android Studio however my SDK is placed in C:\Android\sdk. However I also have Android Studio in Program Files where there are no jar for Google play services.
Information:Gradle tasks [clean, :app:generateDebugSources, :app:compileDebugSources]
Error:A problem occurred configuring root project 'XXXXXX'.
Could not resolve all dependencies for configuration ':classpath'.
Could not find com.google.gms:google-services:9.0.0.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/9.0.0/google-services-9.0.0.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/gms/google-services/9.0.0/google-services-9.0.0.jar
https://jcenter.bintray.com/com/google/gms/google-services/9.0.0/google-services-9.0.0.pom
https://jcenter.bintray.com/com/google/gms/google-services/9.0.0/google-services-9.0.0.jar
Required by:
:XXXXX:unspecified
Information:BUILD FAILED
Information:Total time: 6.148 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Also my ANDROID_HOME is set to C:\Android\sdk.
Please advise.
By checking other SO question. You can find that Google Play Service updating to version 9.0.0 has a bug issue.
Some solution is by checking if you have enabled offline work for gradle, deselect Offline Work if it's checked. Then, confirm if you have latest version of Google services mentioned as dependencies in project level build.gradle: classpath 'com.google.gms:google-services:3.0.0'. Clean and build the project after the gradle sync completes.
Also, some people fixed it by just deleting the debug.keystore file found in the android folder.
Check this SO question for more information.

Why CMSAdapter and contenthub is not available?

As per Stanbol documentation, I've checked-out source code (% svn co http://svn.apache.org/repos/asf/stanbol/trunk stanbol) and after did maven build. All is fine. Now I've started executable jar (org.apache.stanbol.launchers.full-1.0.0-SNAPSHOT).
After starting this I do not see any menu option to open CMSAdapter and contenthub. I can only see /enhancer, /topic, /entityhub, /sparql, /ontonet, /rules, and /reasoners in the menu option.
Here is the localhost page -
When I saw the checked-out directory then I did not find folders corresponding to cmsadpater and contenthub.
After I tried to download complete zip from source again and now i can see cmsadpater and contenthub -
But I'm getting error during build.
Please suggest what I'm missing here.
[ERROR] Failed to execute goal on project org.apache.stanbol.launchers.full: Could not resolve dependencies for project org.apache.stanbol:org.apache.stanbol.launchers.full:jar:0.12.0: Failure to find org.apache.sling:org.apache.sling.launchpad:xml:bundlelist:8 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
ContentHub and CMSAdapter components have been discontinued from version 1.x. You can still find them at 0.12.x branch (https://svn.apache.org/repos/asf/stanbol/branches/release-0.12/)
Hope that helps

Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-all.zip'

I am a greenhorn in gradle and i just tried to create a new Android Gradle Project in IntelliJ. After filling up the necessities it started to download something which took hours so i decided to force quit my IDE and open the project again.
And now I am getting this:
And when I open the IDE logs, I see this:
2014-12-13 22:27:37,940 [103759372] INFO - .BaseProjectImportErrorHandler - Failed to import Gradle project at '/Users/ramswaroop/Documents/My Workspace/PopoPics'
org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-all.zip'.
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:124)
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:112)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)
at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter.run(DefaultBuildActionExecuter.java:46)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.doResolveProjectInfo(GradleProjectResolver.java:177)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.access$300(GradleProjectResolver.java:63)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:363)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:335)
at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:214)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:95)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:63)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:475)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3$2.run(ExternalSystemUtil.java:552)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:621)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$3.run(ProgressManagerImpl.java:194)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:181)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$9.run(ProgressManagerImpl.java:530)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:405)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)
Caused by: java.nio.channels.OverlappingFileLockException
at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166)
at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068)
at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:868)
at java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:51)
at org.gradle.wrapper.Install.createDist(Install.java:44)
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:118)
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:112)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
2014-12-13 22:27:37,941 [103759373] WARN - nal.AbstractExternalSystemTask - Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-all.zip'.
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-all.zip'.
at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:106)
at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:158)
at org.jetbrains.plugins.gradle.service.project.BaseGradleProjectResolverExtension.getUserFriendlyError(BaseGradleProjectResolverExtension.java:401)
at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:309)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:164)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:164)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:369)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:335)
at org.jetbrains.plugins.gradle.service.project.GradleExecutionHelper.execute(GradleExecutionHelper.java:214)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:95)
at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:63)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:475)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3$2.run(ExternalSystemUtil.java:552)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:621)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$3.run(ProgressManagerImpl.java:194)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:181)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$9.run(ProgressManagerImpl.java:530)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:405)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)
2014-12-13 22:27:37,942 [103759374] WARN - radle.project.ProjectSetUpTask -
2014-12-13 22:27:37,942 [103759374] INFO - radle.project.ProjectSetUpTask - Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-all.zip'.
Consult IDE log for more details (Help | Show Log)
INFO: Running on Mac Yosemite with Gradle 2.2 and IntelliJ IDEA 14 Ultimate.
It could be that the gradle-2.1 distribution specified by the wrapper was not downloaded properly. This was the root cause of the same problem in my environment.
Look into this directory:
ls -l ~/.gradle/wrapper/dists/
In there you should find a gradle-2.1 folder.
Delete it like so:
rm -rf ~/.gradle/wrapper/dists/gradle-2.1-bin/
Restart IntelliJ, after that it will restart the download from the beginning and hopefully work.
If you are on Windows, you can go to:
C:\Users\{your_name}\.gradle
And delete all the references of the gradle package you can find in those folders:
caches
daemon
wrapper
Then re-open your project and sync gradle
1 Close Android Studio (AS)
2 Delete the folder in C:\Users.gradle\wrapper\dists\gradle-2.1-all
3 Run as admin
4 Sync your project files
First check your Internet conection..
or try with
Tools -> Android -> Sync
or Try
File -> Settings -> Gradle -> Check Offline Work
I had the same problem.
(My problem is with gradle 4.4 files)
Actually the problem is incorrect downloading of 4.4 gradle which already I had.
When I delete gradle 4.4 version
C:\Users\$Your_User\.gradle\wrapper\dists\gradle-4.4-all
Android studio again downloads gradle-4.4 and syncs with my project.
Now it had rectified with the help of Michelin Man
Thanks for your answer Michelin
I cannot believe the below solution, but it did solve it.
in gradle-wrapper.properties file:
change
distributionUrl=http\://services.gradle.org/distributions/gradle-6.1.1-all.zip
to
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
you should also check if you are connecting via proxy. If there is a proxy set it up using File > Settings > Appearance and Behavior > System settings > HTTP Proxy
https://services.gradle.org/distributions/gradle-2.1-all.zip
open this link in the browser and download the zip file and extract it to folder
Before extraction please delete the old folder whose name ends gradle-2.1-all and then you can start extracting
if you are window user extract it to this folder
C:\Users{Your-Name}.gradle\wrapper\dists
after that just restart your android studio.
I hope it works it works for me .
For me, it was just close the android studio and restart as Administrator.
If all above solutions is not working and In case of your project was working fine and now getting this issue, then try this,
go to android studio setting.
select gradle under build,execution.
then again just set path of gradle user home
(C:/Users/%user_name%/.gradle/wrapper/dists/gradle-6.5-bin)
just rebuild again, this helps me.
It could be that the corresponding Gradle version was not downloaded properly.
You could delete the broken file at
rm -rf .gradle/wrapper/dists/
and restart studio.
or try
File -> Settings -> Gradle -> Check Offline Work
and download the file from the official site and extract to the destination location
.gradle/wrapper/dists/
In my case, the problem was that I was not connected to the same VPN with which I installed Android Studio, I do not know why it happens, but even if I have internet access, if I am not connected to the original VPN, the downloads from IDE do not work correctly.
I connected the VPN, I did the gradle again and finally it started to download and install everything correctly.
I also checked that I didn't go through any proxy or anything similar in my Android configuration.
I recently had this same error, but it was due to an outbound firewall / monitoring tool silently killing the download requests in the background.
Sometimes the problem isn't Android Studio or your gradle configuration at all!
In Android Studio, if you open the Design window for the app, there is error message about Gradle being not synched properly. Next to the error, there is a 'Try Again' button. If you click on that, Android studio tries to sycn up again.
That worked for me.
In my case I had to go to
File -> Settings -> Build, Execution, Deployment -> Gradle
and then I changed the Service directory path, which was pointing to a wrong location.
Delete .gradle data
CtrlAltS then navigate to File -> Settings -> Build, Execution, Deployment -> Compiler then check "Sync project with gradle before building, if needed".
My problem was fixed with this method.
Change the distributionUrl=https://services.gradle.org/distributions/gradle-2.1-bin.zip from the Your project folder\gradle\wrapper\gradle-wrapper.properties to new one.
what worked for me is
distributionUrl=https://services.gradle.org/distributions/gradle-6.2.2-all.zip
One more reason for this error (assuming that gradle properly setup) is incompatibility between andorid.gradle tools and gradle itself - check out this answer for the complete compatibility table.
In my case the error was the same as in the question and the stacktrace as following:
java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at com.android.build.gradle.BasePlugin.lambda$configureProject$1(BasePlugin.java:436)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
...
I've fixed that by upgrading com.android.tools.build:gradle to the current latest 3.1.4
buildscript {
repositories {
...
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
}
Gradle version is 4.6
I was facing the same problem in IntelliJ. It was working from command line though.
I found the issue was because of an improper Gradle config in the IDE. I wasn't using the "default Gradle wrapper" as recommended:
On MAC Remove gradle-2.1-all folder from the following path /Users/amitsapra/.gradle/wrapper/dists/gradle-2.1-all and then try gradle build again. I faced same issues with 5.4.1-all.
It takes a little time but fixes everything
For me, the reason is that the gradle.zip IDE downloaded is broken (I cannot uncompress it manually), and following steps help.
gradle sync, and it says could not install from ${link}, ${gralde.zip} ...
download from ${link} manually
go to the ${gradle.zip}'s location
replace the ${gradle.zip} with the one downloaded, remove the .lck file on the same path.
gradle sync.
Note:
${link} is something like https://services.gradle.org/distributions/gradle-4.6-all.zip
${gradle.zip} looks like ~/.gradle/wrapper/dists/gradle-${version}-all/${a-serial-string}/gradle-${version}-all.zip
I have also recieved this issue inside of InteliJ.
Go to the gradle/wrapper folder and modify distributionUrl inside of gradle-wrapper.properties to a correct version.
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
It also disturb me a lot but now it is fine
The solution is very simple (written blow) [window (android studio)]
go to C:\Users\your user name.gradle
open wrapper/dists and delete the folder that is distrubing you in my case --gradle-6.5--
then go back to .gradle folder and this time open daemon folder and delete the folder with same number that is disturbing you in my case --6.5--
Then again go back to .gradle folder and this time open caches folder and delete the folder with same number that is disturbing you in my case --6.5--
now if your android studio is open then close it and again start it but this time with administrator mode by right clicking on the icon of android studio icon it is important
you should have internet connection and now your android studio will setup every thing by its own (please don't distrub it while it is doing its operation)
I solve it by downloading zip file from https://services.gradle.org/distributions/gradle-2.1-all.zip manually, put it inside C:\Users\<username>\.gradle, and sync.
(Only for Mac Users)
download the gradle file from the link and then close the project then at the front page ,under the creat project option there is option called Import project(Gradle,Eclipse ADT,etc) here you have to select the gradle file which you have downloded earlier .
Then restart the Android studio .....hope your problem is solved now
In my case I solved the problem with
Ctrl + Shift+ F
Type 2.1 or just type the version of the gradle that can't be installed
replace the version of gradle with the correct one in the gradle-Wrapper.properties
File in my case I replaced it with 6.1.1
Guys In my case the gradle is not properly install thats why this issue is happan with me.
Resolution:
Go to User Directory
Then Go to .gradle\wrapper\dists
Remove the folder which you are facing error
Invalidate cache and restart your android studio
Download directly from Gradle: https://services.gradle.org/distributions/
Choose the relative version, pay attention to the name behind the version
Open the folder
as shown
enter image description here
You can delete the contents in the wrapper folder before, replace it with the Gradle file you just downloaded, and unzip it. After unzipping, you can delete the compressed file.
Open Gradle settings. Modify the path problem, and then synchronize it. There should be no problem
Here is what worked for me on windows 10.
Close my project.
Close Android Studio.
Run Android Studio.
Open project.
Android studio takes a few minutes while everything sorts itself out.
I thought that maybe Android Studio just needed sufficient rights to extract and put the files in all the right locations and possibly set the path variables.

maven 3.1.0 compile does not use proxy username

Running on Windows XP, I set up my ~/.m2/settings.xml to include the following proxy settings:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>davidho</username>
<password>mypassword</password>
<host>192.168.0.35</host>
<port>3128</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
mvn archetype:generate then worked great, downloading all the required files and succeeding.
But then I tried
mvn compile
and got:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (http.//repo.maven.apache.org/maven2): Error transferring file: Server returned HTTP response code: 407 for URL: http.//repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom from http.//repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom with proxyInfo ProxyInfo{host='192.168.0.35', userName='null', port=3128, type='http', nonProxyHosts='null'}
Huh ?! Why does it say userName='null' when I have specified a username and password in my
settings.xml ?
I then tried:
mvn compile -Dhttp.proxyUser=davidho -Dhttp.proxyPassword=mypassword
and it made no difference - it still said userName='null'
How can I fix this thanks ?
n.b. stackoverflow forced me to change the "http:" in the error message to "http."
Same here, using parameters on the cmd line or in the settings file.
There are few things you need to check!
if you are using IDE then you might be facing issues with Embedded maven installation which is by default value and you can get it resolved by changing maven installation. try this answer.
if you are behind NTLM windows proxy you need to use CNTLM software to get you authenticated which is batter described in this answer.if you are using IDE please change installation as described in first point.