缺少com.google.android:android:jar的依赖关系依赖关系 [英] dependencies.dependency.version' for com.google.android:android:jar is missing
问题描述
我正试图用eclipse运行一个简单的虚拟Android项目,我也试图使用maven。
amd我已经遵循了这个接受的答案的教程post
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
这是我的pom.xml
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>
这是我的控制台日志:
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?
编辑:作为SD答案,我将这些行粘贴到CMD中,解决了这个问题:
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>
选择一个版本可用于此。
如果该版本不可用,并且您有从SDK管理器安装的更高版本,那么您可以将 android.jar
安装到本地maven存储库:
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:
如果 $ ANDROID_HOME
是Android SDK文件夹的路径,而您要版本 4.0.3
它位于 android-15
文件夹下,然后运行:
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
对于Windows用户:
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
这篇关于缺少com.google.android:android:jar的依赖关系依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!