gpt4 book ai didi

java - 使用 maven 构建应用程序

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:27:12 24 4
gpt4 key购买 nike

在使用 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 中添加了依赖项

有谁知道如何解决这个问题?

最佳答案

我认为你的问题与存储库/依赖无关

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)

我怀疑上面那行是问题所在。请查看那里是否有任何错误或重复

关于java - 使用 maven 构建应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18181932/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com