Reputation: 2486
I have an Android project that depends on an android library (apklib) project. The projects builds fine within Eclipse but my command line build using maven fails complaining of duplicate R class (the R class from my android library project).
Inside my target folder I have three subdirectories.
Is the presence and contents of the 'unpack' folder to be expected? The R.java file within it is causing the duplicate R class build failure.
Upvotes: 0
Views: 1374
Reputation: 2486
I had setup the library project's pom.xml incorrectly. I was explicitly including the generated java files under build/resources (artifact of having copied the pom.xml file from another project). Removing that eliminated the duplicate R.java file in the unpack directory. The unpack directory does exist and matches the structure posted in the question.
BTW, the libraryprojects sample failed if I ran 'mvn compile', but works fine for 'mvn install'. I am a maven n00b, so this may be reasonable.
Upvotes: 0
Reputation: 29912
I would suggest to use the latest version of the Android Maven Plugin (3.0.0) and look how the samples for apklib usage are set up. That will solve your problem.
Upvotes: 1