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 8672773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:17:13+00:00 2026-06-12T19:17:13+00:00

I have a test project X that tests project Y. Project Y has library

  • 0

I have a test project X that tests project Y. Project Y has library Z as reference. library Z has a raw resource R1 which I’m trying to open but I keep getting resource not found. The raw resource is in res/raw folder within the library.

I tried openRawResource with the relevant packageManager but it did not seem to help.
Any idea? Is there any logical mistake in my resource allocation?

didn’t work:

PackageManager pmMgr = getInstrumentation().getTargetContext().getPackageManager();
Resources rMgr = pmMgr.getResourcesForApplication("PROJECT.Y.PACKAGE");
InputStream is = rMgr.openRawResource(package.library.z.raw.R1);

neither did

PackageManager pmMgr = getInstrumentation().getContext().getPackageManager();
Resources rMgr = pmMgr.getResourcesForApplication("PROJECT.Y.PACKAGE");
InputStream is = rMgr.openRawResource(package.library.z.raw.R1);

P.S.
I verified that R1 is wrapped into the .apk of the referenced project (Y) under res/raw as well.

  • 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-06-12T19:17:15+00:00Added an answer on June 12, 2026 at 7:17 pm

    Answering my own questions.
    Although only a day has passed since my question.. I’ve been struggling with this issue for a few days.

    The solution is painfully stupid.
    Newer versions of ADT require that you use the project library to call on resources even if they’re from referenced libraries. E.g. to working code sample is:

    PackageManager pmMgr = getInstrumentation().getTargetContext().getPackageManager();
    Resources rMgr = pmMgr.getResourcesForApplication("PROJECT.Y.PACKAGE");
    InputStream is = rMgr.openRawResource(package.library.Y.raw.R1);
    

    the only change is in the last line, Y instead of Z.

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

Sidebar

Related Questions

I have setup an android test project that runs junit tests. It's using two
I have a seperate Test Project in Eclipse that has been running successfully for
I have a software project that has the following structure. - Library A -
HI, I want to have set configuration settings for a unit test project that
I have a test project, with an App.config that sets up default values for
I have a unit test project in Visual Studio 2010 (.NET 4) that utilizes
I have one project inside that I have SqlServerFunctions in test.cs file. code: [Microsoft.SqlServer.Server.SqlFunction]
I have a test project in which I needs to load an XLSX file.
I have a class library project which uses a namespace (e.g., Cosmos.Creator.Util). I then
I have a separate project which performs watiN tests. The project is in the

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.