Failed to load late-bound plugin: org.apache.maven.plugins:maven-resources-plugin - maven-2

We have our local Maven repository which was working fine till yesterday.
Today we are getting the following error while building any project.
Failed to load late-bound plugin: org.apache.maven.plugins:maven-resources-plugin
We haven't change any settings. Any idea?

It's hard to say because you skipped the next line that prints the Reason. A typical output looks like:
[WARN] Failed to load plugin: org.apache.maven.plugins:maven-resources-plugin. Adding to late-bound plugins list.
Reason: Failed to load plugin. Reason: The plugin 'org.apache.maven.plugins:maven-resources-plugin' does not exist or no valid version could be found
It would have been interesting to join this line to find a fix for the root cause of the problem.

I resolved it.
I had to delete the plugins folder on my local repository then Maven downloaded the plugins again.
It works fine now.

Related

react native problem with creating apk: gradle mergeDexRelease

My app works well on react-native-run-android and on gradlew clean provide me build success.
I used to check and creating the apk by using gradlew assembleRelease.
Recently, I faced an error while trying to create the APK and I cant find the right solution.
as far as I understand, some problem with the build.gradle or any gradle settings - the last feature I put was the mauron background geolocation (im not sure if that cause the problem).
I tried:
on gradle.properties :
android.useAndroidX=true
android.enableJetifier=true
org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4608m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
in build.gradle I added: implementation 'androidx.multidex:multidex:2.0.1' in the dependencies.
3.
defaultConfig {
...
multiDexEnabled true
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
// multiDexEnabled true
}
The gradle I used was 6.3. So I upgraded (downloaded from their website v7 but I think the project is still under 6.3).
My question is:
If the app works and build successfuly, was the error because of my code or the gradle settings?
Im over a week with that problem and out of any clue how to get it work.
the error I get:
> Task :app:mergeDexRelease FAILED
D8: Program type already present: org.apache.commons.io.Charsets
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Program type already present: org.apache.commons.io.Charsets
full picture: https://ibb.co/87pFnv1 , https://ibb.co/FxB8PWX
could anyone help me with it?
The error is not about multidex. It clearly says that one of your package is trying to add a library which is already there.
Since you have the name of the library you can put conditional implementation in your build.gradle to avoid redundant implementation.
for example
Implementation('new package that has module'){
exclude module: 'module to exclude'
}
Finally I solved the problem, Thanks Shashank Shekhar for directing me to the correct problem.
I used mauron85/react-native-background-geolocation package, was working fine until I tried to create apk.
in mauron85 issue #505 there was similar problem and someone fixed it by forking and maintaining the repo.
if anyone face that issue in future, I recommend to use #darron1217/react-native-background-geolocation as it solved the error.
Resolved: I have two packages #react-native-masked-view/masked-view (from previous developer) and #react-native-community/masked-view. Just remove #react-native-masked-view/masked-view package and try build.
https://github.com/react-native-masked-view/masked-view/issues/100#issuecomment-841634389 Thanks to: Navipro70

Strange error when upgrading play-services-auth from 15.0.0 to 16.0.1

For my android project I upgraded play-services-auth library version from 15.0.0 to 16.0.1
Since then I see following error during the build and it also produces
ajcore files
I have removed my .gradle caches and done build and still see this error.
Anybody else seen this before, how do I fix it?
java.lang.IllegalStateException: Expecting .,<, or ;, but found authapi while unpacking Lcom/google/android/gms/common/api/internal/BaseImplementation$ApiMethodImpl;
at org.aspectj.util.GenericSignatureParser.parseClassTypeSignature(GenericSignatureParser.java:204)
at org.aspectj.util.GenericSignatureParser.parseFieldTypeSignature(GenericSignatureParser.java:155)
at org.aspectj.util.GenericSignatureParser.parseTypeArgument(GenericSignatureParser.java:267)
In my case, removing the Hugo logging plugin fixed the issue.
Check in your gradle file if you have it configured.
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
It happens because some plugin (added by you) use libs:
org.aspectj:aspectjtools
or
org.aspectj:aspectjrt for codegeneration

Trouble with jitpack/gradle in Intellij

I'm still getting started with gradle, but I found jitpack to allow for including dependencies across my github repos.
I'm having issues getting dependencies to resolve, though. Some releases work, but other times I get "could not resolve."
I have managed to reproduce this with a couple of github repos:
I set up a repo to be depended on: https://github.com/bdleitner/dummy-dependency
and one to depend on it: https://github.com/bdleitner/dummy-client
From jitpack, I can see the build log for the 0.1.3 release of dummy-dependency:
https://jitpack.io/com/github/bdleitner/dummy-dependency/0.1.3/build.log
where it seems that everything is successful.
when logged in to jitpack, it can see this release and provides the compile statement:
compile 'com.github.bdleitner:dummy-dependency:0.1.3'
but even when I include that in the gradle.build file for dummy-client,
I get:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not resolve com.github.bdleitner:dummy-dependency:0.1.3.
Required by:
com.bdl:dummy-client:1.0-SNAPSHOT
> No cached version of com.github.bdleitner:dummy-dependency:0.1.3 available for offline mode.
> No cached version of com.github.bdleitner:dummy-dependency:0.1.3 available for offline mode.
> No cached version of com.github.bdleitner:dummy-dependency:0.1.3 available for offline mode.
I figure I'm probably missing something small and dumb, but I haven't been able to find it.
Apparently, I somehow managed to switch my gradle settings to offline mode (not sure how)... but unchecking that option appears to have fixed the issue.
Sorry to bother everyone.

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.

Problems w/ OpenJML Update Site

When I try to install the openJML plugin from the update site at http://jmlspecs.sourceforge.net/openjml-updatesite I get the following error:
An error occurred while collecting items to be installed
session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Artifact not found: ... (with about 4 or 5 jars)
I've tried installing previous versions of the plugin, but all result in similar "Artifact not found" errors. Anyone have any idea why this isn't working? Or have a workaround I could use to get the Eclipse plugin to work?
Thanks in advance!
A bug report has already been opened, but no one seems to care (yet):
http://sourceforge.net/p/jmlspecs/bugs/397/
Seems that you have to compile your own version of it.