dependencies.dependency.version“为com.google.android:android:jar缺失 [英] dependencies.dependency.version' for com.google.android:android:jar is missing

查看:749
本文介绍了dependencies.dependency.version“为com.google.android:android:jar缺失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行与Eclipse一个简单的虚拟机器人项目,也是我试图使用Maven。 AMD我按照接受的答案对<一个教程href="http://stackoverflow.com/questions/6735562/using-maven-android-archetype-with-eclipse">this交

这是我的pom.xml

 &LT; XML版本=1.0编码=UTF-8&GT?;
    &LT;项目的xmlns =htt​​p://maven.apache.org/POM/4.0.0的xmlns:XSI =htt​​p://www.w3.org/2001/XMLSchema-instance
    XSI:的schemaLocation =htt​​p://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    &LT; modelVersion&GT; 4.0.0&LT; / modelVersion&GT;
    &LT;的groupId&GT; ir.raysis&LT; /的groupId&GT;
    &LT; artifactId的&GT;匆匆&LT; / artifactId的&GT;
    &LT;版&GT; 0.0.1  - 快照 -  LT; /版本&GT;
    &LT;包装&GT; APK&LT; /包装&GT;
    &LT;名称&gt;&匆匆LT; /名称&gt;

    &LT;性状&gt;
        &LT; project.build.sourceEncoding&GT; UTF-8&LT; /project.build.sourceEncoding>
        &LT; platform.version&GT;&LT; /platform.version>
        &LT; android.plugin.version&GT; 3.5.3&LT; /android.plugin.version>
    &LT; /性状&gt;

    &LT;依赖&GT;
        &LT;依赖&GT;
            &LT;的groupId&GT; com.google.android&LT; /的groupId&GT;
            &LT; artifactId的&GT;的android&LT; / artifactId的&GT;
            &LT;版&GT; $ {platform.version}&LT; /版本&GT;
            &LT;范围&GT;提供与LT; /范围&GT;
        &LT; /依赖性&GT;
    &LT; /依赖性&GT;
    &LT;建立&GT;
        &LT; finalName&GT; $ {project.artifactId}&LT; / finalName&GT;
        &LT; pluginManagement&GT;
            &LT;插件&GT;
                &LT;插件&GT;
                    &LT;的groupId&GT; com.jayway.maven.plugins.android.generation2&LT; /的groupId&GT;
                    &LT; artifactId的&GT; Android的行家,插件和LT; / artifactId的&GT;
                    &LT;版&GT; $ {android.plugin.version}&LT; /版本&GT;
                    &LT;扩展&GT;真&LT; /扩展&GT;
                &LT; /插件&GT;
            &LT; /插件&GT;
        &LT; / pluginManagement&GT;
        &LT;插件&GT;
            &LT;插件&GT;
                &LT;的groupId&GT; com.jayway.maven.plugins.android.generation2&LT; /的groupId&GT;
                &LT; artifactId的&GT; Android的行家,插件和LT; / artifactId的&GT;
                &lt;结构&GT;
                    &LT; SDK&GT;
                        &LT;平台&GT; 18 LT; /平台&GT;
                    &LT; / SDK&GT;
                &LT; /结构&gt;
            &LT; /插件&GT;
        &LT; /插件&GT;
    &LT; /编译&GT;
&LT; /项目&GT;
 

这是我的控制台日志:

  SLF4J:无法加载类org.slf4j.impl.StaticLoggerBinder。
SLF4J:默认到无操作(NOP)记录器的实施
SLF4J:见http://www.slf4j.org/$c$cs.html#StaticLoggerBinder进一步的细节。
[信息]扫描项目...
[错误]构建无法读取1个项目 - &GT; [说明1]
[错误]
[错误]项目com.raysis:匆匆:0.0.1-快照(D:\ RaySIS \程序\ RaySISPP \ TISWS \匆匆\ pom.xml的),有1个错误
[错误]dependencies.dependency.version为com.google.android:android:jar缺失。 @ 21行,第13栏
[错误]
[错误]要查看错误的完整的堆栈跟踪,重新运行Maven和-e开关。
[错误]使用-x开关来实现完整的调试日志记录重新运行Maven。
[错误]
[错误]有关错误和可能的解决方案,请阅读以下文章:
[错误] [说明1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
 

任何一个可以告诉我应该怎么做才能运行这个简单的项目?

编辑:为SD answerd,我在CMD粘贴这些行,并解决了这个问题:

  MVN安装:安装文件-Dfile =%ANDROID_HOME%/平台/ Android为18 /的android.jar-DgroupId = com.google.android-DartifactId = Android的-Dversion = 4.3,-Dpackaging =罐子-DgeneratePom =真
 

解决方案

您需要提供相应的版本:

 &LT; platform.version&GT; 4.1.1.4&LT; /platform.version>
 

选择一个版本<一href="http://search.maven.org/#search%7Cgav%7C1%7Cg%3a%22com.google.android%22%20AND%20a%3a%22android%22">available这里

如果该版本不可用,你必须从SDK管理器安装版本,那么你就可以安装的android.jar 来的本地仓库:

如果 $ ANDROID_HOME 是路径到Android SDK文件夹,你想版本 4.0.3 这是在的android-15 文件夹,然后运行:

  MVN安装:安装文件\
 -Dfile = $ ANDROID_HOME /平台/ Android为15 /的android.jar \
 -DgroupId = com.google.android \
 -DartifactId =机器人\
 -Dversion = 4.0.3 \
 -Dpackaging =罐\
 -DgeneratePom =真
 

对于Windows用户:

  MVN安装:安装文件-Dfile =%ANDROID_HOME%\平台\ Android为15 \的android.jar -DgroupId = com.google.android -DartifactId =安卓-Dversion = 4.0 0.3 -Dpackaging =罐子-DgeneratePom =真
 

i am trying to run a simple dummy android project with eclipse and also i am trying to use maven. amd i have followed the tutorial of the accepted answer on this post

this is my pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>ir.raysis</groupId>
    <artifactId>quickie</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>apk</packaging>
    <name>quickie</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <platform.version></platform.version>
        <android.plugin.version>3.5.3</android.plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <version>${platform.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <finalName>${project.artifactId}</finalName>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                    <artifactId>android-maven-plugin</artifactId>
                    <version>${android.plugin.version}</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.jayway.maven.plugins.android.generation2</groupId>
                <artifactId>android-maven-plugin</artifactId>
                <configuration>
                    <sdk>
                        <platform>18</platform>
                    </sdk>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

and this is my console log :

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.raysis:quickie:0.0.1-SNAPSHOT (D:\RaySIS\programming\RaySISPP\TISWS\quickie\pom.xml) has 1 error
[ERROR]     'dependencies.dependency.version' for com.google.android:android:jar is missing. @ line 21, column 13
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

can any one tell what should i do to run this simple project?

EDIT: as S.D answerd, i pasted these lines in CMD and that solved the problem :

mvn install:install-file  "-Dfile=%ANDROID_HOME%/platforms/android-18/android.jar"  "-DgroupId=com.google.android"  "-DartifactId=android"  "-Dversion=4.3" "-Dpackaging=jar"  "-DgeneratePom=true"

解决方案

You need to provide an appropriate version:

<platform.version>4.1.1.4</platform.version>

Choose a version available here.

If that version is not available and you have a later version installed from SDK manager, then you can install that android.jar to local maven repository:

If $ANDROID_HOME is path to Android SDK folder, and you want version 4.0.3 which is under android-15 folder, then Run:

mvn install:install-file \
 -Dfile=$ANDROID_HOME/platforms/android-15/android.jar \
 -DgroupId=com.google.android \
 -DartifactId=android \
 -Dversion=4.0.3 \
 -Dpackaging=jar \
 -DgeneratePom=true

For Windows user:

mvn install:install-file -Dfile=%ANDROID_HOME%\platforms\android-15\android.jar -DgroupId=com.google.android -DartifactId=android -Dversion=4.0.3 -Dpackaging=jar -DgeneratePom=true

这篇关于dependencies.dependency.version“为com.google.android:android:jar缺失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆