I am trying to build with maven our android existing project that has been build with eclipse. I had to do a lot of changes and tinkering around pom.xml files. Project is dependent on other projects, so they have their own pom.xml files.

I was able to individually compile these projects with their pom.xml's but the master project I am getting this error:

   cannot find symbol: class R
   package R does not exist


I am using intellij12. The master pom.xml is given below.

   <?xml version="1.0" encoding="UTF-8"?>
   <project xmlns="http://maven.apache.org/POM/4.0.0
   <http://maven.apache.org/POM/4.0.0>"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
   <http://www.w3.org/2001/XMLSchema-instance>"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
   
<http://maven.apache.org/POM/4.0.0>http://maven.apache.org/xsd/maven-4.0.0.xsd
   <http://maven.apache.org/xsd/maven-4.0.0.xsd>">
   <modelVersion>4.0.0</modelVersion>
   <artifactId> corp </artifactId>
   <version>1.0-SNAPSHOT</version>
   <parent>
   <groupId>com.corp</groupId>
   <artifactId> corp-android</artifactId>
   <version>1.0</version>
   <relativePath>../pom.xml</relativePath>
   </parent>
   <repositories>
   <!--TODO remove absolute paths-->
   <repository>
   <id>libGoogleAnalyticsV2</id>
   
<url>file:///Users/malugus/code/android/corp/libs/libGoogleAnalyticsV2.jar</url>
   </repository>
   <repository>
   <id>flurryagent</id>
   <url>file:///Users/malugus/code/android/corp/libs/FlurryAgent.jar</url>
   </repository>
   <repository>
   <id>beacon-utils</id>
   
<url>file:///Users/malugus/code/android/corp/libs/beacon-utils-0.0.8.jar</url>
   </repository>
   </repositories>
   <dependencies>
   <dependency>
   <groupId>com.google.analytics</groupId>
   <artifactId>libGoogleAnalyticsV2</artifactId>
   <version>r2</version>
   </dependency>
   <dependency>
   <groupId>com.flurry.android.FlurryAgent</groupId>
   <artifactId>flurryagent</artifactId>
   <version>1.0.0</version>
   <scope>provided</scope>
   </dependency>
   <dependency>
   <groupId>us.beacondigital.utils</groupId>
   <artifactId>beacon-utils</artifactId>
   <version>1.0.0</version>
   </dependency>

   <dependency>
   <groupId>com.viewpagerindicator</groupId>
   <artifactId>library</artifactId>
   <version>2.4.1</version>
   <type>apklib</type>
   </dependency>

   <dependency>
   <groupId>com.actionbarsherlock</groupId>
   <artifactId>actionbarsherlock</artifactId>
   <version>4.2.0</version>
   </dependency>
   <dependency>
   <groupId>com.slidingmenu</groupId>
   <artifactId>slidingmenu</artifactId>
   <version>1.2.2</version>
   </dependency>

   </dependencies>

   <build>
   <finalName>${project.artifactId}</finalName>

   <plugins>
   <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-resources-plugin</artifactId>
   <executions>
   <execution>
   <!-- use the copy resources instead of resources, which adds it to
                                the eclipse buildpath -->
   <phase>initialize</phase>
   <goals>
   <goal>copy-resources</goal>
   </goals>
   <configuration>
   <outputDirectory>${project.basedir}/res</outputDirectory>
   <resources>
   <resource>
   <directory>${project.basedir}/src/templates/res</directory>
   <targetPath>${project.basedir}/res</targetPath>
   <filtering>true</filtering>
   </resource>
   </resources>
   </configuration>
   </execution>
   </executions>
   </plugin>
   <plugin>
   <groupId>com.jayway.maven.plugins.android.generation2</groupId>
   <artifactId>android-maven-plugin</artifactId>
   <extensions>true</extensions>
   <configuration>
   <manifest>
   <debuggable>true</debuggable>
   </manifest>
   </configuration>
   <executions>
   <execution>
   <id>manifestUpdate</id>
   <phase>process-resources</phase>
   <goals>
   <goal>manifest-update</goal>
   </goals>
   </execution>
   <execution>
   <id>alignApk</id>
   <phase>package</phase>
   <goals>
   <goal>zipalign</goal>
   </goals>
   </execution>
   </executions>
   </plugin>
   </plugins>
   </build>
</project>

There are few things I want to mention about this I am only sure about the dependencies part, the plugin part is something I pasted from other sample projects and this is where I think the trouble is. Also ignore the parent part I think it has no use for me.

Based on the error seems like project is not building in the correct order, first it needs to build/compile R and then so on, right? Pointers in right direction are appreciated.

-Satyajit

Reply via email to