java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/app/ActivityManagerCompat

java lang noclassdeffounderror failed resolution of: landroid app notificationchannel
java.lang.noclassdeffounderror failed resolution of android studio
java lang noclassdeffounderror failed resolution of landroidx recyclerview widget recyclerview
java lang noclassdeffounderror failed resolution of landroid view view oncapturedpointerlistener
java lang noclassdeffounderror failed resolution of: landroid/webkit/renderprocessgonedetail
java lang noclassdeffounderror failed resolution of landroid view surfacecontrol builder
failed resolution of landroidx core animation/animatorcompathelper
java lang noclassdeffounderror failed resolution of: landroid/support/v8/renderscript/renderscript

I want to build todolist app.I want to store information using RoomDatabse. I build Database with room and get infomation than save to database. But when i click add button then i got exception. I have searched for an appropriate solution over the web but didn't find anything useful. Please help me.

My exception
 Caused by: java.lang.ClassNotFoundException: Didn't find class
"" while store data using Room.
My Android Studio Configuration
compileSdkVersion 27
buildToolsVersion '28.0.3'
minSdkVersion 15
targetSdkVersion 27
My Database Class
@Database(entities = {TaskEntry.class},version = 1,exportSchema = false)

@TypeConverters(DateConverter.class) public abstract class AppDatabase extends RoomDatabase {

private static final String LOG_TAG=AppDatabase.class.getSimpleName();
private static final Object LOCK=new Object();
private static final String DATABASE_NAME="todolist";
private static AppDatabase mInstance;

public static AppDatabase getInstance(Context context){

        synchronized (LOCK){
            Log.d(LOG_TAG,"Creating new database instance");
            mInstance= Room.databaseBuilder(context.getApplicationContext(),
    Log.d(LOG_TAG,"getting the database instance");
    return mInstance;


public abstract TaskDao taskDao();


My AddTaskActivity Code
public class AddTaskActivity extends AppCompatActivity {

// Extra for the task ID to be received in the intent
public static final String EXTRA_TASK_ID = "extraTaskId";
// Extra for the task ID to be received after rotation
public static final String INSTANCE_TASK_ID = "instanceTaskId";
// Constants for priority
public static final int PRIORITY_HIGH = 1;
public static final int PRIORITY_MEDIUM = 2;
public static final int PRIORITY_LOW = 3;
// Constant for default task id to be used when not in update mode
private static final int DEFAULT_TASK_ID = -1;
// Constant for logging
private static final String TAG = AddTaskActivity.class.getSimpleName();
// Fields for views
EditText mEditText;
RadioGroup mRadioGroup;
Button mButton;

private int mTaskId = DEFAULT_TASK_ID;
private AppDatabase mDb;

protected void onCreate(Bundle savedInstanceState) {


    if (savedInstanceState != null && savedInstanceState.containsKey(INSTANCE_TASK_ID)) {
        mTaskId = savedInstanceState.getInt(INSTANCE_TASK_ID, DEFAULT_TASK_ID);

    Intent intent = getIntent();
    if (intent != null && intent.hasExtra(EXTRA_TASK_ID)) {
        if (mTaskId == DEFAULT_TASK_ID) {
            // populate the UI

protected void onSaveInstanceState(Bundle outState) {
    outState.putInt(INSTANCE_TASK_ID, mTaskId);

 * initViews is called from onCreate to init the member variable views
private void initViews() {
    mEditText = findViewById(;
    mRadioGroup = findViewById(;

    mButton = findViewById(;
    mButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {

 * populateUI would be called to populate the UI when in update mode
 * @param task the taskEntry to populate the UI
private void populateUI(TaskEntry task) {


 * onSaveButtonClicked is called when the "save" button is clicked.
 * It retrieves user input and inserts that new task data into the underlying database.
public void onSaveButtonClicked() {
    // Not yet implemented
    String description=mEditText.getText().toString();
    int priority=getPriorityFromViews();
    Date date=new Date();
    TaskEntry taskEntry=new TaskEntry(description,priority,date);

 * getPriority is called whenever the selected priority needs to be retrieved
public int getPriorityFromViews() {
    int priority = 1;
    int checkedId = ((RadioGroup) findViewById(;
    switch (checkedId) {
            priority = PRIORITY_HIGH;
            priority = PRIORITY_MEDIUM;
            priority = PRIORITY_LOW;
    return priority;

 * setPriority is called when we receive a task from MainActivity
 * @param priority the priority value
public void setPriorityInViews(int priority) {
    switch (priority) {
        case PRIORITY_HIGH:
            ((RadioGroup) findViewById(;
        case PRIORITY_MEDIUM:
            ((RadioGroup) findViewById(;
        case PRIORITY_LOW:
            ((RadioGroup) findViewById(;


In your gradle dependencies, do you use this?

implementation "$room_version"
annotationProcessor "$room_version"

If so, replace it with:

    implementation ''
    annotationProcessor ''

Failed resolution of: Landroidx/core/view/ViewCompat · Issue #463 , So there is some issue with 2.0.0 that on this line App got crashed Failed resolution of: Landroidx/core/util/Pools$SynchronizedPool; #2365. I split my app project into other modules and after implementing DI and splitting the dependencies across the modules, I get this exception: java.lang.NoClassDefFoundError: Failed resolution of:

you might be missing the dependency ...


which provides

java.lang.NoClassDefFoundError: when trying to implement 64bit , Description java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/​fragment/app/FragmentActivity Which version? The newer  I have searched a lot here and on Google and found no answer that solved my problem. When i run my app from instant run, it works perfectly. When i generate my release APK, it doesn't open and show

Try migrating the project to AndroidX according to steps given in the link ""

Change existing package and class names to those given in the sub-section ""

AppCompatActivity, Intent that will launch an explicit target activity specified by sourceActivity's <meta-data> element in the is a legacy Android support library. Since Google Play Services now uses Jetpack (AndroidX) it's now incompatible with that component. The Jetifier integration in the Android Resolver should be rewriting references to the legacy Android support library to AndroidX except for cases where a plugin developer has just dropped an aar or jar in the project.

NoClassDefFoundError: Ошибка разрешения: Landroidx / core , Вопрос по теме: java, android, android-studio, android-gradle. java.lang.​NoClassDefFoundError: Не удалось разрешить: Landroidx/core/app/​ActivityManagerCompat NoClassDefFoundError: Failed resolution of:  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

User Rabbi hasan, java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/app/​ActivityManagerCompat · java android android-room android-activitymanager asked  Hi, when starting the application, when it was already compiled, an exception occurs: Java.Lang.NoClassDefFoundError: Failed resolution of: This site uses cookies for analytics, personalized content and ads.

Hi, got the following errors while I compile my app in release build tested on HTC One M8, Android 5.0 [MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] Java.Lang.NoClassDefFoundError: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown.

  • Good answer! Main difference is use (or not) AndroidX.
  • Thanks for your answer.I figure out solution.I use pre-androidX but here i use androidX..This is the paroblem.