Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 659
MikeNereson Avatar asked Feb 02 '23 20:02

MikeNereson


2 Answers

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>

like image 168
MikeNereson Avatar answered Feb 05 '23 08:02

MikeNereson


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:

like image 39
Nam Vu Avatar answered Feb 05 '23 08:02

Nam Vu