无法使用Maven编译android内部应用程序

时间:2012-08-01 10:27:36

标签: android build maven-3

我试图使用maven编译android ics 4.0.4手机应用程序。通过添加所需的内部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,如here所述。现在,当我编译时,它说无法找到一些内部类。这是日志:

`[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] ------------------------------------------------------------------------
.
.
.
`

在framework_intermediates jar中显然缺少com.android.internal.telephony.OperatorInfo。关于为什么会失败的任何想法?

0 个答案:

没有答案