以下这个问题 缠绕了 我很长时间 google 上搜了半天也没有相关的说明或者很乱!
环境:eclipse 3.6,ADT-14.0.0.zip,maven 2.0.11,maven-android-plugin 2.8.4,M2eclipse
pom.xml 内容如下
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
使用 mvn package 报错
Cannot find required method com.android.sdklib.build.ApkBuilder.addNativeLibraries(java.io.File, java.lang.String)
Cannot find required method
java.lang.NoSuchMethodException: com.android.sdklib.build.ApkBuilder.addNativeLibraries(java.io.File, java.lang.String)
at java.lang.Class.getMethod(Class.java:1605)
at com.jayway.maven.plugins.android.phase09package.ApkBuilder.initialize(ApkBuilder.java:102)
at com.jayway.maven.plugins.android.phase09package.ApkMojo.initializeAPKBuilder(ApkMojo.java:294)
at com.jayway.maven.plugins.android.phase09package.ApkMojo.createApkFile(ApkMojo.java:162)
at com.jayway.maven.plugins.android.phase09package.ApkMojo.execute(ApkMojo.java:144)
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:319)
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: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)
折腾了很久终于找到关键所在 我将maven 升级到 maven 3.0.3 在将android-maven-plugin 升级到 3.0.0
设置 eclipse windows-preferences-maven-installations 添加 本地安装的maven3.0目录
修改后的pom.xml
当让你也可以将签名 流程 配置到 pom里!
在解决这个问题的同时搜索到不少好的文章以下共享链接:
http://www.cnblogs.com/Pickuper/archive/2011/06/14/2078969.html
http://www.blogjava.net/askcuix/archive/2011/03/07/345897.html
http://www.cnblogs.com/feisky/archive/2011/03/13/1650076.html
http://code.google.com/p/maven-android-plugin/issues/detail?id=209#c0
http://code.google.com/p/maven-android-plugin/issues/detail?id=210
http://www.cnblogs.com/abob/archive/2010/06/24/1764521.html
最后有什么不明白的 可以留言!