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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:48:17+00:00 2026-06-14T13:48:17+00:00

What does this message in Eclipse’s logcat for Android mean? W/ActivityThread: ClassLoader.getResources: The class

  • 0

What does this message in Eclipse’s logcat for Android mean?

W/ActivityThread: ClassLoader.getResources: The class loader returned by Thread.getContextClassLoader() may fail for processes that host multiple applications. You should explicitly specify a context class loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());

Unfortunately, there is no context given as to this warning, so I don’t know what causes this problem and how I can resolve 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-06-14T13:48:19+00:00Added an answer on June 14, 2026 at 1:48 pm

    Background information

    The message means that Android has setup a dummy ClassLoader with Thread.currentThread().setContextClassLoader(), and something tries to use that dummy class loader. The something can be a lot of things, it’s hard to tell exactly what from the information given. There is a trick you can try though, see below. Anyway, Android sets up the dummy class loader when there is a risk that the process might contain code from more than one APK. More specifically, Android looks in your manifest if you have used android:sharedUserId:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        ...
        android:sharedUserId="triggers.dummy.loader" >
    

    or if you run in a non-standard android:process

        <application android:process="triggers.dummy.loader">
    

    How to get rid of the warning

    There are two things you can do to get rid of the warning:

    1. Don’t use android:sharedUserId or android:process
    2. Explicitly set what APK ClassLoader to use before running any other code

    To go with solution 2, there are some key insights you need. First, for any class AnyClass in an APK, AnyClass.class.getClassLoader() will return the same ClassLoader. Second,

    AnyClass obj = new AnyClass();
    Thread.currentThread().setContextClassLoader(obj.getClass().getClassLoader())
    

    is the same as

    Thread.currentThread().setContextClassLoader(AnyClass.class.getClassLoader())
    

    Third, you need to call Thread.currentThread().setContextClassLoader(getClass().getClassLoader()) before the code that calls Thread.currentThread().getContextClassLoader().
    Fourth, When many APKs are involved, you need to call Thread.setContextClassLoader(getClass().getClassLoader()) after the last APK has been loaded (otherwise loading the last APK will overwrite what you have set manually). Because of that, it would be a good idea to find out who is using the context class loader in you case by using the below debug trick. Then, right before that, you call Thread.setContextClassLoader(getClass().getClassLoader()) for a class from the desired APK, typically the APK that is loaded first (or, in the case when only one APK is involved, that APK ;). Fifth, the context class loader is per thread, which you need to keep in mind if your application is multi-threaded.

    Debug trick

    If you want to find out what code that calls ClassLoader.getResources(), this should work:

    Thread.currentThread().setContextClassLoader(new ClassLoader() {
        @Override
        public Enumeration<URL> getResources(String resName) throws IOException {
            Log.i("Debug", "Stack trace of who uses " +
                    "Thread.currentThread().getContextClassLoader()." +
                    "getResources(String resName):", new Exception());
            return super.getResources(resName);
        }
    });
    

    if you do this early enough, you should see in the logcat a stack trace that goes back to whoever calls getResources() on the dummy class loader.

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

Sidebar

Related Questions

I got an error in Eclipse. What does this error message means: The type
Does anyone know what this error message means? FATAL: Code generation error detected during
in this sample method/message: -(void) setNumerator:(int) n { numerator = n; } What does
Does this mean I can't update another table from a trigger if I'm using
I can get my junit class to work from eclipse. But it does'nt work
When I start Tomcat (6.0.18) from Eclipse (3.4), I receive this message (first in
Using: Eclipse, JSF, Facelets. <h:message for=loginButton> This tag is used outside the form which
Why does Glassfish shows this facelets error: javax.el.ELException: /foo/client.xhtml @11,74 value=#{messageBean.messages}: javax.mail.MessagingException: Socket closed;
How does Branchout custom their Request Dialog messages? There is no option for this.
Does this code always evaluate to false? Both variables are two's complement signed ints.

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.