2011-03-23 85 views
9

为我的Android应用程序添加支持installLocation我在我的IDE(IntelliJ)中将我的android等级从7提升到8。 Android应用程序从IntelliJ构建得很好。Android + Maven“在包'android'中找不到属性'installLocation'的资源标识符”

虽然我们使用maven,但是从Maven它无法编译。

[ERROR] C:\dev\svnlocal\5x\android\AndroidManifest.xml:3: error: No resource identifier found for attribute 'installLocation' in package 'android' 
[ERROR] Error when generating sources. 

我还添加了

<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8"/> 

我不断收到

No resource identifier found for attribute 'installLocation' in package 'android' 

我已经改变了我的依赖性和

<dependency> 
    <groupId>android</groupId> 
    <artifactId>android</artifactId> 
    <version>2.1_r1</version> 
    <scope>provided</scope>  
</dependency> 

<dependency> 
    <groupId>com.google.android</groupId> 
    <artifactId>android</artifactId> 
    <version>2.2.1</version> 
    <scope>provided</scope>  
</dependency> 

但我仍然收到此错误消息。

什么是缺失?

回答

6

随着mvn package -X我可以看到它编译android-sdk-windows/platforms/android-7而不是android-8

我终于跟踪它到

<plugins> 
    <plugin> 
    <groupId>com.jayway.maven.plugins.android.generation2</groupId> 
    <artifactId>maven-android-plugin</artifactId> 
    ... 
    <sdk> 
     <platform>7</platform> 
    </sdk> 

platform应该已经<platform>8</platform>

+0

其中我可以找到这一位代码? – 2012-03-15 16:32:28

+0

@chiragsaga这段代码摘自我的maven'pom.xml' – MikeNereson 2012-03-16 01:24:18

6

构建目标,但是,需要更新到至少API等级8(安卓2.2),否则你会得到以下错误:

error: No resource identifier found for attribute ‘installLocation’ in package ‘android’

通过编辑项目属性(右键单击Eclipse中的项目)更改构建目标,并选择至少具有API级别8的目标:

相关问题