faruktoptas / FancyShowCaseView

An easy-to-use customisable show case view with circular reveal animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot Access Kotlin unit

muarachmann opened this issue · comments

Used FancyShowCaseView version

me.toptas.fancyshowcase:fancyshowcaseview:1.3.1

Screenshot if there is something wrong with ui

All is fine just that I cant hide it manually. I am detecting if there is a click on the backbutton and if
fancy was currently showing then hide it.

How you show/hide FancyShowCaseView (in Activity or Fragment, in which method)

 @Override
    public void onBackPressed() {
        if (FancyShowCaseView.isVisible(this)) {
            FancyShowCaseView.hideCurrent(this);
        }

Error

            FancyShowCaseView.hideCurrent(this);
                                         ^
  class file for kotlin.Unit not found

Your layout.xml file if the focus is wrong

@muarachmann can you share your build.gradle file please?

@faruktoptas here

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "xxxxx.xxxx.xxxx"
        minSdkVersion 19
        //noinspection OldTargetApi
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 5
        versionName "1.0.5"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        lintOptions {
            checkReleaseBuilds false
            abortOnError false
        }
        dexOptions {
            javaMaxHeapSize "4g"
        }
    }
    allprojects {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

    //noinspection GradleCompatible
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.preference:preference:1.1.1'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.annotation:annotation:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.firebase:firebase-core:17.4.4'
    implementation 'com.google.firebase:firebase-auth:19.3.2'
    implementation 'com.google.firebase:firebase-firestore:21.5.0'
    implementation 'com.google.firebase:firebase-storage:19.1.1'
    implementation 'com.google.firebase:firebase-analytics:17.4.4'
    implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
    implementation 'com.google.firebase:firebase-messaging:20.2.3'
    implementation 'com.google.firebase:firebase-iid:20.2.3'
    implementation 'com.google.firebase:firebase-config:19.2.0'
    implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
    implementation 'com.facebook.android:facebook-android-sdk:5.0.3'
    implementation 'com.facebook.android:facebook-login:[5,6)'
    implementation 'com.twitter.sdk.android:twitter:3.3.0@aar'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.hbb20:ccp:2.3.7'
    implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
    implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
    implementation 'com.github.smarteist:autoimageslider:1.3.9'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.google.android.play:core:1.7.3'
    implementation 'com.anjlab.android.iab.v3:library:1.0.44'
    implementation 'com.daimajia.easing:library:2.1@aar'
    implementation 'com.daimajia.androidanimations:library:2.3@aar'
    implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
    implementation 'com.twitter.sdk.android:twitter-core:3.1.1'
    implementation 'com.twitter.sdk.android:tweet-ui:3.1.1'
    implementation 'com.treebo:internetavailabilitychecker:1.0.4'
    implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.3.1'

   
    // Room components
    implementation "androidx.room:room-runtime:$rootProject.roomVersion"
    annotationProcessor "androidx.room:room-compiler:$rootProject.roomVersion"
    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
    debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
    debugImplementation 'com.amitshekhar.android:debug-db-encrypt:1.0.6'

    // Lifecycle components
    implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.archLifecycleVersion"
    implementation "androidx.work:work-runtime:$work_version"
    implementation "androidx.work:work-gcm:$work_version"

    //noinspection LifecycleAnnotationProcessorWithJava8
    annotationProcessor "androidx.lifecycle:lifecycle-compiler:$rootProject.archLifecycleVersion"

    // Testing
    androidTestImplementation "androidx.arch.core:core-testing:$rootProject.coreTestingVersion"

    implementation 'com.google.guava:guava:27.0.1-android'
}

// Google Services Gradle plugin
apply plugin: 'com.google.gms.google-services'
// Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'

This library is written in kotlin language. So you need to add kotlin dependency to your project.

@muarachmann Is your problem solved?