Alex
Alex

Reputation: 1339

Compilation failure: android support-v4 + maven

I am compiling my android project with maven. I have used maven android sdk deployer to install android sdk to local repository. Everything was working fine until I added some notification code. I still can launch my app from eclipse, but maven build gives following errors:

[ERROR] cannot find symbol
[ERROR] symbol  : method create(com.my.example.SomeService)
[ERROR] location: class android.support.v4.app.TaskStackBuilder
[ERROR] cannot find symbol
[ERROR] symbol  : method build()
[ERROR] location: class android.support.v4.app.NotificationCompat.Builder

Here is support-v4 dependency from my pom file

<dependency>
    <groupId>com.android.support</groupId>
    <artifactId>support-v4</artifactId>
    <version>21.0.0-rc1</version>
    <type>aar</type>
</dependency>

Can anyone help pls?

Update

The error occuring in the project (lets call it A) that depends on several library projects (say B, C and D) each of which depends on support-v4 library. B, C and D are build with maven too and have same support-v4:aar:21.0.0-rc1 dependency as project A. Can this cause such problem?

Upvotes: 0

Views: 480

Answers (1)

Alex
Alex

Reputation: 1339

The issue is resolved! The reason was that one of the dependencies (referenced as B, C and D in the question) of the main project had an old version of support-v4 as a dependency. Once it's dependency was updated the build succceeded.

Hope it will help someone.

Upvotes: 1

Related Questions