Migrate a kotlin application

Good morning

It’s been a while since I created an Android app.
The problem is that I want to open the project on another computer but I cannot migrate my application to a more recent version of Kotlin.

Here is my gradle build.
I tried to migrate several times but nothing happened.

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.30'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'


android {
    compileSdkVersion 31
    defaultConfig {
        applicationId "fr.tais.riori"
        minSdkVersion 19
        targetSdkVersion 31
        versionCode 21
        versionName "1.80"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

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.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'


    //implementation 'com.android.support:design:28.0.0'
    implementation 'com.google.android.material:material:1.1.0-alpha09'

    implementation 'org.jetbrains.anko:anko-common:0.9'

    implementation 'com.github.kittinunf.fuel:fuel-android:2.0.1'
    implementation 'com.github.kittinunf.fuel:fuel-gson:2.0.1'
    implementation 'com.github.kittinunf.fuel:fuel-coroutines:2.0.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'net.gotev:uploadservice:3.5.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.kyanogen.signatureview:signature-view:1.2'

    implementation 'me.dm7.barcodescanner:zxing:1.9'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

Is there a tutorial online as I have already spent a lot of time on it?

What exactly is the problem you’re trying to solve here? Are you saying you do want to upgrade your project to use a newer version of Kotlin, or you don’t want to upgrade it? Also, when you say you “want to open the project on another computer”, you mean open it in IntelliJ, and IntelliJ refuses because the version of Kotlin is too old?

Since then I have managed to migrate my project to a recent version of kotlin.

I only have one problem left with Viewbinding

I added to gradle

    buildFeatures {
        viewBinding = true
    }

But I don’t understand how to replace my old code which was going to take the elements of my recyclerview one by one

import kotlinx.android.synthetic.main.activity_piecechoix.*
import kotlinx.android.synthetic.main.pieceslistmini.view.*
        for(mapi in pieceslist){

            mavaleurpiece = piece_recycler_view.getChildAt(tag).qstock.text.toString()
            moncompteur = mapi.cptbpr.toString()
            utilise= piece_recycler_view.getChildAt(tag).utilise.isChecked.toString()
            machainepiece = machainepiece + "&cpt" + tag + "=" + moncompteur + "&qte" + tag + "=" + mavaleurpiece + "&utilise" + tag + "=" + utilise
            tag = tag +1
        }

i try to do a binding to “piece_recycler_view” recyclerview but the function “getChildAt” don’t work.

I am lost