9

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?

j0k
  • 22,600
  • 28
  • 79
  • 90
MikeNereson
  • 3,890
  • 6
  • 24
  • 28

2 Answers2

6

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>

MikeNereson
  • 3,890
  • 6
  • 24
  • 28
6

The build target, however, needs to be updated to at least API Level 8 (Android 2.2), otherwise you’ll get the following error:

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

Change the build target by editing the project properties (right-click on the project in Eclipse), and choose a target with at least API Level 8:

Nam Vu
  • 5,669
  • 7
  • 58
  • 90