Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7058657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:08:19+00:00 2026-05-28T04:08:19+00:00

I’m trying to extract the Android /res folder into a separate project that’s included

  • 0

I’m trying to extract the Android /res folder into a separate project that’s included in my main project as an apklib dependency. The problem is that while the contents of the /res are included in the resulting .apklib, the compiled R.class is not. Even more confusing is that the mvn clean install command generates the .apklib as well as a .jar file, and the jar file has R.class, but none of the contents of the /res folder. How do I generate a single package (either .jar or .apklib) that contains all of my resources as well as the compiled classes?

pom.xml

<packaging>apklib</packaging>
...
<plugin>
  <groupId>com.jayway.maven.plugins.android.generation2</groupId>
  <artifactId>android-maven-plugin</artifactId>
  <configuration>
    <attachSources>true</attachSources>
    <sdk>
      <platform>12</platform>
    </sdk>
  </configuration>
<plugin>

Which generates the following

.jar

./morseflash-resources.jar
  com/.../R.class    

.apklib

./morseflash-resorces.apklib
  META-INF
  AndroidManifest.xml
  res/
      layout/
      values/

I’d like all this content in a single file, and I’d like to be able to list it as a dependency in my main Android project. Is this possible, and if so, how could I accomplish it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:08:20+00:00Added an answer on May 28, 2026 at 4:08 am

    This is how android-maven-plugin is supposed to work, to add the library project as a dependency of your main project, add the following dependency into your main project’s pom.xml:

    <dependencies>
      <dependency>
        <groupId>com.company.common.lib</groupId>
        <artifactId>common-lib</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <type>apklib</type>
      </dependency>
    </dependencies>
    

    Note that this is different from regular jar dependencies, the apklib is simply a zip of all your src and res folders that has the standard directory structure layout of an Android/Eclipse library project (src/com/... instead of src/main/java/com/...). The reason for that is to support using apklib in other non-mavenlized projects (check out the ApkLib documentation for details). You are not adding your library as a compiled jar dependency, instead, you are adding your library dependency as source-code and resources, simply from a zip file.

    When doing mvn clean install, in the android-maven-plugin:3.0.0:generate-sources goal, android-maven-plugin will unzip your apklib dependency and merge the source-code and resources into your main project before compiling your project; this is how Android Library Projects are supposed to work. The Library Project is not just simply compiling everything. To save memory and disc-space only the used parts are copied and compiled into the final apk. You can override the resources easily in the main project, as they just replace the library stuff at the merge step before final compile.

    It’s ugly but it is how things work at the moment, Android Dev team is currently working on this and will support the jar dependency in the future, probably in r17 (which also requires android-maven-plugin change/upgrade I suppose), more details in their official blog post “Changes to Library Projects in Android SDK Tools, r14 “.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.