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

  • Home
  • SEARCH
  • 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 8625361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:45:58+00:00 2026-06-12T07:45:58+00:00

I want to use slf4j with logback in my Android application (IDE Eclipse). I

  • 0

I want to use slf4j with logback in my Android application (IDE Eclipse).
I have already added the jars file (slf4j-api-1.7.1 logback-android-1.0.7-1.jar) to build path in Eclipse.
I try to launch my app in Adv with the following simple main activity

import org.slf4j.Logger
import org.slf4j.LoggerFactory
public class MainActivity extends Activity{
    private static final Logger logger = 
              LoggerFactory.getLogger(MainActivity.class);
    private void onnCreate(Bundle svedInstanceState){
         super.onCreate(savedInstanceState) 
         logger.debug("MainActivity created");
    }
}

and i get the following error captured by logcat

10-02 16:03:46.911: I/dalvikvm(619): Could not find method org.slf4j.LoggerFactory.getLogger, referenced from method com.mbm.activity.MainActivity.<clinit>
10-02 16:03:46.911: W/dalvikvm(619): VFY: unable to resolve static method 3250: Lorg/slf4j/LoggerFactory;.getLogger (Ljava/lang/Class;)Lorg/slf4j/Logger;
10-02 16:03:46.941: I/dalvikvm(619): Could not find method org.slf4j.Logger.debug, referenced from method com.mbm.activity.MainActivity.onToggleClicked
10-02 16:03:46.941: W/dalvikvm(619): VFY: unable to resolve interface method 3248: Lorg/slf4j/Logger;.debug (Ljava/lang/String;)V
10-02 16:03:46.941: I/dalvikvm(619): Could not find method org.slf4j.Logger.info, referenced from method com.mbm.activity.MainActivity.onToggleClicked
10-02 16:03:46.941: W/dalvikvm(619): VFY: unable to resolve interface method 3249: Lorg/slf4j/Logger;.info (Ljava/lang/String;)V
10-02 16:03:46.951: W/dalvikvm(619): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/mbm/activity/MainActivity;
10-02 16:03:46.951: W/dalvikvm(619): Class init failed in newInstance call (Lcom/mbm/activity/MainActivity;)
10-02 16:03:46.951: W/dalvikvm(619): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
10-02 16:03:46.961: E/AndroidRuntime(619): FATAL EXCEPTION: main
10-02 16:03:46.961: E/AndroidRuntime(619): java.lang.ExceptionInInitializerError
10-02 16:03:46.961: E/AndroidRuntime(619):  at java.lang.Class.newInstanceImpl(Native Method)
10-02 16:03:46.961: E/AndroidRuntime(619):  at java.lang.Class.newInstance(Class.java:1319)
10-02 16:03:46.961: E/AndroidRuntime(619):  at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
10-02 16:03:46.961: E/AndroidRuntime(619):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
10-02 16:03:46.961: E/AndroidRuntime(619):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
10-02 16:03:46.961: E/AndroidRuntime(619):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
10-02 16:03:46.961: E/AndroidRuntime(619):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
10-02 16:03:46.961: E/AndroidRuntime(619):  at android.os.Handler.dispatchMessage(Handler.java:99)
10-02 16:03:46.961: E/AndroidRuntime(619):  at android.os.Looper.loop(Looper.java:137)
10-02 16:03:46.961: E/AndroidRuntime(619):  at android.app.ActivityThread.main(ActivityThread.java:4745)
10-02 16:03:46.961: E/AndroidRuntime(619):  at java.lang.reflect.Method.invokeNative(Native Method)
10-02 16:03:46.961: E/AndroidRuntime(619):  at java.lang.reflect.Method.invoke(Method.java:511)
10-02 16:03:46.961: E/AndroidRuntime(619):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-02 16:03:46.961: E/AndroidRuntime(619):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-02 16:03:46.961: E/AndroidRuntime(619):  at dalvik.system.NativeStart.main(Native Method)
10-02 16:03:46.961: E/AndroidRuntime(619): Caused by: java.lang.NoClassDefFoundError: org.slf4j.LoggerFactory
10-02 16:03:46.961: E/AndroidRuntime(619):  at com.mbm.activity.MainActivity.<clinit>(MainActivity.java:41)
10-02 16:03:46.961: E/AndroidRuntime(619):  ... 15 more

Please help me.

  • 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-12T07:45:59+00:00Added an answer on June 12, 2026 at 7:45 am

    i solved alone the issue with the following steps:
    1) put the 2 jar files in a new folder in your project.
    2) add jars to build path
    3) in Java Build Path prefernce enter in the “Order and Export” tab and select the two jars, then press ok.
    4) Project –> Clean!!
    After these steps the app runs fine without errors!!

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

Sidebar

Related Questions

We have a powerbuilder application and we want use a scanner through this application
I want to use default SLF4J + Logback configuration except setting org.springframework.data.document.mongodb logging level
i have an application for which i want use some reporting framework to generate
I want use a single php file to handle all of my voting requests.
i want use some data from a website with web service. i have a
I want use JQuery mobile for the front-end of my mobile application, but I
I want use MVVM design pattern in WPF and Silverlight Application. Where can i
I want use a typedef struct that isn't already defined, but it is later.
I want use html5's new tag to play a wav file (currently only supported
I have a Java web application that uses the SLF4J logging facade. To date,

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.