Can Not Perform Copy-Paste in Android Studio

UPDATE --> There is a bug in Kotlin libraries with Windows 10 Single Language Turkish. (Maybe some of other Single Language Windows distributions have same issue, I haven't known yet.) Kotlin's some libraries cannot work on Turkish operating system. I solved this problem with installing Windows 10 Pro English.

Other developers who use Windows 10 Single Language Turkish faces same problem with different angles. (Example1 and Example2)

OLD ANSWER

TL;DR -> Problem is about third party libraries that are written with Kotlin. I have converted my Java project to Kotlin and all problematic third party libraries work well. Problem is about Java - Kotlin conflict.

I would like to share how I solved the problem for those who will face such problems later.

I did all the steps I mentioned above one by one but I could not find any solution and I decided to examine my third party libraries.

First of all, I disabled all third party libraries and looked at the status of my classes that did not recognize already defined methods and attributes. After disabling third party libraries and making Rebuild Project and Sync Gradle, the Auto Suggestion feature of those corrupted classes started working again.Then, uncovering which third-party libraries were problematic, I activated those third-party libraries one by one. I found which third party libraries broke my project.

There were 4 third party libraries that broke my project : StickySwitch, ProgressView, SequenceLayout and Flashbar. When I removed those libraries, everything worked right. After removed the libraries, my Gradle file was as below.

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.lotusif.dump2"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.core:core:1.1.0'

    // material widgets
    implementation 'com.google.android.material:material:1.2.0-alpha03'

    // progress bar with text BUGGY!
    // implementation "com.github.skydoves:progressview:1.0.3"

    // sequence progress BUGGY !
    // implementation 'com.github.transferwise:sequence-layout:1.0.11'

    // flash bar BUGGY !
    // implementation 'com.andrognito.flashbar:flashbar:1.0.2'

    // toggle - switch button BUGGY !
    // implementation 'com.github.GwonHyeok:StickySwitch:0.0.15'

    // Custom Toast message
       implementation 'com.github.GrenderG:Toasty:1.4.2'

    // liquid effect bar
       implementation 'com.mikhaellopez:circularfillableloaders:1.3.2'


    // bubble tab bar
       implementation 'com.fxn769:bubbletabbar:1.0.3'

    // android chart library
       implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'

    //glide image library
    implementation 'com.github.bumptech.glide:glide:4.10.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'

    // scaling layout
    implementation 'com.github.iammert:ScalingLayout:1.2.1'

    // lottie animation
    implementation 'com.airbnb.android:lottie:3.3.1'

    //Gson
    implementation 'com.google.code.gson:gson:2.8.6'

    //RxJava
    implementation 'io.reactivex.rxjava2:rxjava:2.2.15'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'

    implementation 'com.daimajia.easing:library:2.1@aar'
    implementation 'com.daimajia.androidanimations:library:2.3@aar'

    //retrofit
    implementation 'com.squareup.retrofit2:converter-gson:2.7.1'
    implementation 'com.squareup.retrofit2:retrofit:2.7.1'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.7.1'
}

So, what was the common feature of those libraries that corrupt my project? My project was written with Java but that libraries were written with Kotlin. One second, cannot I use Kotlin libraries in my Java project? Yes, I can. I have to add android.useAndroidX=true and android.enableJetifier=true in my gradle.properties, that is it. But what if I have already added those lines in my gradle.properties and it has not worked?

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

I have not understood why kotlin libraries cannot work with my Java project. As you can see in my Gradle file, I am using apply plugin: 'kotlin-android' and apply plugin: 'kotlin-android-extensions' for Kotlin support.

How I have rescued my project? There were 2 available options as I knew. While first method was that to removed those 4 third party libraries and could not use them, second one that to convert all Java classes to Kotlin classes (I tried it before but it did not work until disabled all third party libraries). I chose to convert all Java classes to Kotlin classes. Thus, I was able to use 4 third party libraries which were mentioned above.

It took me 30 days to solve this problem. Now, I am working on Kotlin language. As a result, my project is running without any problem.