Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid aapt duplicate files error when building with ant
    primarykey
    data
    text
    <p>I am using ant to make a build system for our android project which has two build targets, Dev and Release.</p> <p>This involves replacing the default <code>-package-resources</code> target with my own one in my build.xml. It goes from this:</p> <pre><code>&lt;target name="-package-resources" depends="-crunch"&gt; &lt;!-- only package resources if *not* a library project --&gt; &lt;do-only-if-not-library elseText="Library project: do not package resources..." &gt; &lt; aapt executable="${aapt}" command="package" versioncode="${version.code}" versionname="${version.name}" debug="${build.is.packaging.debug}" manifest="${out.manifest.abs.file}" assets="${asset.absolute.dir}" androidjar="${project.target.android.jar}" apkfolder="${out.absolute.dir}" nocrunch="${build.packaging.nocrunch}" resourcefilename="${resource.package.file.name}" resourcefilter="${aapt.resource.filter}" libraryResFolderPathRefid="project.library.res.folder.path" libraryPackagesRefid="project.library.packages" previousBuildType="${build.last.target}" buildType="${build.target}" ignoreAssets="${aapt.ignore.assets}" &gt; &lt;res path="${out.res.absolute.dir}" /&gt; &lt;res path="${resource.absolute.dir}" /&gt; &lt;!-- &lt;nocompress /&gt; forces no compression on any files in assets or res/raw --&gt; &lt;!-- &lt;nocompress extension="xml" /&gt; forces no compression on specific file extensions in assets and res/raw --&gt; &lt;/aapt&gt; &lt;/do-only-if-not-library&gt; &lt;/target&gt; </code></pre> <p>To this :</p> <pre><code>&lt;target name="-package-resources" depends="-crunch"&gt; &lt;!-- only package resources if *not* a library project --&gt; &lt;echo message="Packaging resources with ${package.internal} as a package name" /&gt; &lt;do-only-if-not-library elseText="Library project: do not package resources..." &gt; &lt;exec executable="${aapt}" failonerror="true"&gt; &lt;arg value="package" /&gt; &lt;arg value="-f" /&gt; &lt;arg value="-v" /&gt; &lt;arg value="-M" /&gt; &lt;arg path="${out.manifest.abs.file}" /&gt; &lt;arg value="-A" /&gt; &lt;arg path="${asset.absolute.dir}" /&gt; &lt;arg value="-I" /&gt; &lt;arg path="${project.target.android.jar}" /&gt; &lt;arg value="-m" /&gt; &lt;arg value="-J" /&gt; &lt;arg path="${out.absolute.dir}" /&gt; &lt;arg value="-F" /&gt; &lt;arg path="${out.absolute.dir}/${resource.package.file.name}" /&gt; &lt;arg value="-S" /&gt; &lt;arg path="${out.res.absolute.dir}" /&gt; &lt;arg path="${resource.absolute.dir}" /&gt; &lt;arg value="--no-crunch" /&gt; &lt;arg value="--rename-manifest-package" /&gt; &lt;arg value="${package.internal}" /&gt; &lt;/exec&gt; &lt;/do-only-if-not-library&gt; &lt;/target&gt; </code></pre> <p>However, when I launch the build, it fails on this step with the following error:</p> <pre><code>-package-resources: [echo] Packaging resources with dev.appname.android as a package name [exec] Found 4 custom asset files in /appname/app/native/android/appname/assets [exec] Processing raw dir '/appname/app/native/android/appname/res' [exec] /appname/app/native/android/appname/res/drawable/map_marker.png: error: Duplicate file. [exec] /appname/app/native/android/appname/bin/res/drawable/map_marker.png: Original is here. </code></pre> <p>Not sure how to proceed here. My understanding was that the <code>-f</code> flag should take care of overwriting files.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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