1

I am using the following gardle

{
compileSdkVersion 28
defaultConfig {
    applicationId "fitness.ayman.salah.fitness"
    minSdkVersion 22
    targetSdkVersion 28
    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 fileTree(dir: 'libs', include: ['*.jar'])
   implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
   implementation 'com.android.support.constraint:constraint-layout:1.1.3'
   testImplementation 'junit:junit:4.12'
   androidTestImplementation 'com.android.support.test:runner:1.0.2'
   androidTestImplementation 'com.android.support.test.espresso:espresso- 
   core:3.0.2'
  compile 'com.github.bumptech.glide:glide:4.0.0'
 }

I am trying to use TabLayout, but it cannot find it (cannot resolve TabLayout).

Any suggestion?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
user93865
  • 147
  • 2
  • 15
  • Possible duplicate of [Android Studio cannot resolve symbol 'TabLayout'](https://stackoverflow.com/questions/32686324/android-studio-cannot-resolve-symbol-tablayout) – letsintegreat Nov 01 '18 at 06:42

3 Answers3

1

You haven't added the Design Support Library in your dependencies. Add these lines of code according to your compile and target sdk

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.0'
Ishtdeep Hora
  • 310
  • 2
  • 4
  • I did that I changed my version to 27 and added you code I got error. Message{kind=ERROR, text=error: expected enum but got (raw string) auto., sources=[D:\Android\Android Studio\gradle\caches\transforms-1\files-1.1\design-27.1.0.aar\f4b5d3a736bc356bea11f9cdeb7331cc\res\values\values.xml:270:5-275:13], original message=, tool name=Optional.of(AAPT)} Invalidate the cache even removed it manually, restarted the studio cleaned the project rebuild it Same error above. – user93865 Nov 01 '18 at 14:37
0

I found the problem

I removed the following from my attrs.xml

 <attr name="fabSize">
    <enum name="normal" value="0" />
    <enum name="mini" value="1" />
  </attr>

Problem disappeared. I am not sure exactly why this cause the problem. But SOLVED

user93865
  • 147
  • 2
  • 15
0

I suggest you to use this implementation

implementation 'com.android.support:design:28.1.0'

my case solved with that implementaion

Oops
  • 1