Can't load AppCompat ActionBar with the unknown error.Android Studio 3.1.3

I'm facing this problem even when I tried switching from

com.android.support:appcompat-v7:28.0.0-alpha 3 to

com.android.support:appcompat-v7:28.0.0-alpha 1.

It works, but after adding some new activities it causes the same problem. I went to Invalidate caches/restart and restart my Android studio but it didn't work...

Please any expert who help me thanks... I'm really in trouble for the last couple of days.

1 answer

  • answered 2018-07-11 04:13 Sreekant Shenoy

    Use the previous gradle version 27, and change your project gradle config to this. The new alpha-one might cause problems with new activities sometimes.

    Just clean and rebuild after gradle sync.

    android {
        compileSdkVersion 27
        defaultConfig {
            applicationId "com.package.name"
            minSdkVersion 22
            targetSdkVersion 27
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support:support-compat:27.1.1'
        implementation 'com.android.support:design:27.1.1'
    
    }