5

Mavenを使用してAndroid APPを構築しているときに、以下の例外が発生します

> [ERROR] Cannot add resources from
> ~/.m2/repository/com/inmobi/androidsdk/AdNetwork/3.5.4/AdNetwork-3.5.4.jar
> com.android.sdklib.build.DuplicateFileException: Duplicate files at
> the same path inside the APK  at
> com.android.sdklib.build.ApkBuilder$JavaAndNativeResourceFilter.checkEntry(ApkBuilder.java:125)
>   at
> com.android.sdklib.internal.build.SignedJarBuilder.writeZip(SignedJarBuilder.java:228)
>   at
> com.android.sdklib.build.ApkBuilder.addResourcesFromJar(ApkBuilder.java:576)
>   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
> com.jayway.maven.plugins.android.phase09package.ApkBuilder.addResourcesFromJar(ApkBuilder.java:292)
>   at
> com.jayway.maven.plugins.android.phase09package.ApkMojo.doAPKWithAPKBuilder(ApkMojo.java:586)
>   at
> com.jayway.maven.plugins.android.phase09package.ApkMojo.createApkFile(ApkMojo.java:356)
>   at
> com.jayway.maven.plugins.android.phase09package.ApkMojo.execute(ApkMojo.java:307)
>   at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
>   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:320)   at
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)  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)

SDK jar (AdNetwork-3.5.4.jar) をローカル リポジトリに追加し、pom に依存関係を追加しました。

誰もこれを修正する方法を知っていますか?

4

2 に答える 2

0

maven-android-plugin に以下を追加してみてください。

<extractDuplicates>true</extractDuplicates>

ソース

于 2013-08-12T08:05:17.450 に答える