我正在尝试使用 maven 编译 android ics 4.0.4 Phone 应用程序。通过将所需的内部 jar 添加为系统库,我能够使用 eclipse 正确编译。所需的罐子是:classes-full-debug.jar 来自
framework_intermediates
android-common_intermediates
guava_intermediates
ext_intermediates
com.android.phone.common_intermediates
com.android.vcard_intermediates
的构建。
这是的依赖部分pom.xml
:
`
<dependencies>
<dependency>
<groupId>com.username.ics</groupId>
<artifactId>framework_intermediates</artifactId>
<version>0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.username.ics</groupId>
<artifactId>android-common_intermediates</artifactId>
<version>0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.username.ics</groupId>
<artifactId>com.android.phone.common_intermediates</artifactId>
<version>0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.username.ics</groupId>
<artifactId>com.android.vcard_intermediates</artifactId>
<version>0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.username.ics</groupId>
<artifactId>ext_intermediates</artifactId>
<version>0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.username.ics</groupId>
<artifactId>guava_intermediates</artifactId>
<version>0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
`
为了使用 Maven 进行编译,我使用此处mvn install:install-file
所述的命令在本地安装了这些 jar 。现在当我编译时,它说找不到一些内部类。这是日志:
`[INFO] /ssd/packages_app_git/username_ics_packages/apps/Phone/src/com/android/phone/INetworkQueryServiceCallback.aidl:19: couldn't find import for class com.android.internal.telephony.OperatorInfo
[ERROR] Error when generating sources.
org.apache.maven.plugin.MojoExecutionException:
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateAidlFiles(GenerateSourcesMojo.java:451)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.execute(GenerateSourcesMojo.java:118)
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: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)
Caused by: com.jayway.maven.plugins.android.ExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /ssd/packages_app_git/username_ics_packages/apps/Phone && /home/username/Dev/android-sdk-linux/platform-tools/aidl -p/home/username/Dev/android-sdk-linux/platforms/android-15/framework.aidl -I/ssd/packages_app_git/username_ics_packages/apps/Phone/target/generated-sources/extracted-dependencies/src/main/java -I/ssd/packages_app_git/username_ics_packages/apps/Phone/src /ssd/packages_app_git/username_ics_packages/apps/Phone/src/com/android/phone/INetworkQueryServiceCallback.aidl /ssd/packages_app_git/username_ics_packages/apps/Phone/target/generated-sources/aidl/com/android/phone/INetworkQueryServiceCallback.java, Result = 1
at com.jayway.maven.plugins.android.CommandExecutor$Factory$1.executeCommand(CommandExecutor.java:215)
at com.jayway.maven.plugins.android.phase01generatesources.GenerateSourcesMojo.generateAidlFiles(GenerateSourcesMojo.java:449)
... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
.
.
.
`
显然缺少com.android.internal.telephony.OperatorInfo
的是 framework_intermediates jar。关于为什么这可能会失败的任何想法?