Android+Maven "No resource identifier found for attribute 'installLocation' in package 'android'"

MikeNereson picture MikeNereson · Mar 23, 2011 · Viewed 13.1k times · Source

To add support to my android app for installLocation I upped my android level from 7 to 8 in my IDE (IntelliJ). The android app builds fine from IntelliJ.

We use maven though, and from Maven it fails to compile.

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

I've also added

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

I keep getting

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

I'd changed my dependency from

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

to

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

But I was still getting this error message.

What's missing?

Answer

MikeNereson picture MikeNereson · Mar 23, 2011

With mvn package -X I could see that it was compiling with android-sdk-windows/platforms/android-7 rather than android-8.

I finally tracked it down to

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

Where platform should have been <platform>8</platform>