ismaeldivita / chip-navigation-bar

An android navigation bar widget
MIT License
890 stars 136 forks source link

Unresolved class error #56

Closed Mustangodhra closed 3 years ago

Mustangodhra commented 3 years ago

when i use the dependencies, the "tools:context" field of every layout file shows error. i am using it with java so used this dependencies:

implementation 'com.ismaeldivita.chipnavigation:chip-navigation-bar:1.3.2'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.72'

the error shows " Unresolved class 'class_name' ". please help me with this.

SunnerLi commented 3 years ago

Hi, Although I don't encounter this problem, I also use java with this package. The editor I use is android studio. Just share some experience and show in the following:

  1. Set the buildScript which assign gradle the correct kotlin version:
    buildscript {
    ext.kotlin_version = '1.3.30'
    ext.gradle_version = '3.1.0'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:$gradle_version"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
    }
  2. Add kotlin plugin:
    apply plugin: 'kotlin-android'
  3. Add dependencies:
    dependencies {
    implementation 'com.ismaeldivita.chipnavigation:chip-navigation-bar:1.3.4'
    implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    }
  4. Click Sync now text and rebuild the project.
ismaeldivita commented 3 years ago

Closing due inactivity