Home » Android » java – How do I resolve these Maven internal errors?

java – How do I resolve these Maven internal errors?

Posted by: admin June 15, 2020 Leave a comment

Questions:

I am trying to build the popular zxing barcode scanner, following the directions listed here.

I have used multiple versions of Maven, but regardless of what version I use, when I type the command mvn package android:apk as instructed, I get strange errors that have never been seen by man before.

Errors:

 [ERROR] Internal error: com.google.inject.ProvisionException: Guice provision errors:[ERROR] 
[ERROR] 1) No implementation for org.eclipse.aether.impl.VersionResolver was bound.
[ERROR] while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
[ERROR] at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
[ERROR] at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
[ERROR] while locating org.eclipse.aether.RepositorySystem
[ERROR] while locating com.jayway.maven.plugins.android.phase_prebuild.AarMavenLifecycleParticipant
[ERROR] at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
[ERROR] at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
[ERROR] while locating org.apache.maven.AbstractMavenLifecycleParticipant annotated with @com.google.inject.name.Named(value=AarMavenLifecycleListener)
[ERROR] 
[ERROR] 1 error
[ERROR] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: com.google.inject.ProvisionException: Guice provision errors:

1) No implementation for org.eclipse.aether.impl.VersionResolver was bound.
  while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
  while locating org.eclipse.aether.RepositorySystem
  while locating com.jayway.maven.plugins.android.phase_prebuild.AarMavenLifecycleParticipant
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
  while locating org.apache.maven.AbstractMavenLifecycleParticipant annotated with @com.google.inject.name.Named(value=AarMavenLifecycleListener)

1 error
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: com.google.inject.ProvisionException: Guice provision errors:

1) No implementation for org.eclipse.aether.impl.VersionResolver was bound.
  while locating org.eclipse.aether.internal.impl.DefaultRepositorySystem
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
  while locating org.eclipse.aether.RepositorySystem
  while locating com.jayway.maven.plugins.android.phase_prebuild.AarMavenLifecycleParticipant
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
  at ClassRealm[extension>com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.9.0-rc.1, parent: [email protected]]
  while locating org.apache.maven.AbstractMavenLifecycleParticipant annotated with @com.google.inject.name.Named(value=AarMavenLifecycleListener)

1 error
        at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:999)
        at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
How to&Answers:

Change the version to 3.9.0-rc.2 for android-maven-plugin solved the issue.