-1

I'm android beginner currently exploring RecycleView. After I added recycleview dependency in the build.gradle I tried to add it to my layout, but my background is not white as it's supposed to be but kind of blackish, showing text in the middle of the screen that says - androidx.recyclview.widget.RecycleView. It's the same problem as the How to use androidx.recyclerview.widget.RecyclerView with tools:listitem? and I followed instructions that were given there but nothing is happening. Does somebody know what seems to be the problem?

My build.gradle file

import com.google.gms.googleservices.GoogleServicesPlugin

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.faks_app"
        minSdkVersion 25
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-firestore:19.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
}
apply plugin: 'com.google.gms.google-services'

1 Answers1

0

The tag for a RecyclerView in android x <androidx.recyclerview.widget.RecyclerView

Make sure that's what you're using in your XML. Sometimes even if it shows you the dark grey + class name in preview doesn't mean that it's broken, sometimes it's just as easy as File -> Invalidate caches and restart, clean project and try to run the app.

Roudi
  • 1,249
  • 2
  • 12
  • 26