# Migrate a kotlin application

**URL:** <https://discuss.kotlinlang.org/t/migrate-a-kotlin-application/27529>\
**Category:** Uncategorized\
**Created:** [October 24, 2023, 7:06am UTC](https://discuss.kotlinlang.org/t/migrate-a-kotlin-application/27529 "2023-10-24T07:06:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![traxes44](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@traxes44](https://discuss.kotlinlang.org/u/traxes44)\
**Post date:** [October 24, 2023, 7:06am UTC](https://discuss.kotlinlang.org/t/migrate-a-kotlin-application/27529/1 "2023-10-24T07:06:43Z")

</div>

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.

```auto
// 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
}

```

```auto
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?

---

<div class="post-metadata">

**Author:** ![Skater901](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/skater901/32/10163_2.png) [@Skater901](https://discuss.kotlinlang.org/u/Skater901)\
**Post date:** [October 25, 2023, 9:41am UTC](https://discuss.kotlinlang.org/t/migrate-a-kotlin-application/27529/2 "2023-10-25T09:41:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![traxes44](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@traxes44](https://discuss.kotlinlang.org/u/traxes44)\
**Post date:** [October 25, 2023, 11:12am UTC](https://discuss.kotlinlang.org/t/migrate-a-kotlin-application/27529/3 "2023-10-25T11:12:16Z")

</div>

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

```auto
    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

```auto
import kotlinx.android.synthetic.main.activity_piecechoix.*
import kotlinx.android.synthetic.main.pieceslistmini.view.*

```

```auto
        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
