Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing pure Java libs, in a Android Maven project
    text
    copied!<p>I have an Android Maven project, which uses pure Java libs, I've struggled with it for hours, the last few days, and no matter what I do, I constantly end up getting the following error:</p> <pre><code>[INFO] d:\Development-Android\SDKs\Android\platform-tools\aapt.exe [package, -f, -M, D:\Development-Android\Workspaces\Android-Workspace\S-O-D\AndroidManifest.xml, -S, D:\Development-Android\Workspaces\Android-Workspace\S-O-D\res, --auto-add-overlay, -A, D:\Development-Android\Workspaces\Android-Workspace\S-O-D\target\generated-sources\combined-assets\assets, -I, d:\Development-Android\SDKs\Android\platforms\android-7\android.jar, -F, D:\Development-Android\Workspaces\Android-Workspace\S-O-D\target\s-o-d-1.0.0.ap_] [ERROR] Cannot add source folder com.android.sdklib.build.DuplicateFileException: Duplicate files at the same path inside the APK at com.android.sdklib.build.ApkBuilder.doAddFile(ApkBuilder.java:716) at com.android.sdklib.build.ApkBuilder.processFileForResource(ApkBuilder.java:762) at com.android.sdklib.build.ApkBuilder.addSourceFolder(ApkBuilder.java:587) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.jayway.maven.plugins.android.phase09package.ApkBuilder.addSourceFolder(ApkBuilder.java:244) at com.jayway.maven.plugins.android.phase09package.ApkMojo.doAPKWithAPKBuilder(ApkMojo.java:341) at com.jayway.maven.plugins.android.phase09package.ApkMojo.createApkFile(ApkMojo.java:249) at com.jayway.maven.plugins.android.phase09package.ApkMojo.execute(ApkMojo.java:207) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534) 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:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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) </code></pre> <p>After long while of trying, I was able to understand that the duplicates referred to, are the duplicate files in the output directories, one of the Android <em>android-classes</em> folder, and maven output <em>classes</em> folder.</p> <p>So before I even go on about it, I've tried to find out (but I was unable to find an answer) does the Android Maven plugin, support the importing of pure Java jars?</p> <p><strong>Ho, yes, VERY IMPORTANT, do clean install, and not only install!!!</strong></p> <p>Thanks in advance,</p> <p>Adam Zehavi.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload