Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Most gradle file updates not working + solutions that are working for me (so far) #261

Open
PearlPetal opened this issue May 20, 2024 · 1 comment

Comments

@PearlPetal
Copy link

Use these blocks where intended, compileOptions didnt need to be changed since the default code already has the correct JavaVersion, but all the other code had formatting issues (Missing parenthesis, no var declarations, wrong quotation for version numbers) should be fixed. I commented out one of the dependencies because I wasn't sure why it was giving me an error and I hopefully won't need it.

compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

dependencies {
    implementation("androidx.appcompat:appcompat:$rootProject.appCompatVersion")

    // Dependencies for working with Architecture components
    // You'll probably have to update the version numbers in build.gradle (Project)

    // Room components
    implementation("androidx.room:room-runtime:$rootProject.roomVersion")
    annotationProcessor("androidx.room:room-compiler:$rootProject.roomVersion")
    androidTestImplementation("androidx.room:room-testing:$rootProject.roomVersion")

    // Lifecycle components
    implementation("androidx.lifecycle:lifecycle-viewmodel:$rootProject.lifecycleVersion")
    implementation("androidx.lifecycle:lifecycle-livedata:$rootProject.lifecycleVersion")
    implementation("androidx.lifecycle:lifecycle-common-java8:$rootProject.lifecycleVersion")

    // UI
    implementation("androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion")
    implementation("com.google.android.material:material:$rootProject.materialVersion")

    // Testing
    testImplementation("junit:junit:$rootProject.junitVersion")
    androidTestImplementation("androidx.arch.core:core-testing:$rootProject.coreTestingVersion")
    //androidTestImplementation ("androidx.test.espresso:espresso-core:$rootProject.espressoVersion", {
        //exclude group: 'com.android.support', module: 'support-annotations'
    //})
    androidTestImplementation("androidx.test.ext:junit:$rootProject.androidxJunitVersion")
}

ext{
    val appCompatVersion = "1.5.1"
    val constraintLayoutVersion = "2.1.4"
    val coreTestingVersion = "2.1.0"
    val lifecycleVersion = "2.3.1"
    val materialVersion = "1.3.0"
    val roomVersion = "2.3.0"
    // testing
    val junitVersion = "4.13.2"
    val espressoVersion = "3.4.0"
    val androidxJunitVersion = "1.1.2"
}
@PearlPetal
Copy link
Author

PearlPetal commented May 20, 2024

There's still an issue with the gradle not being able to sync since its still unable to find the root project version extensions (Dependencies can't get the ext values)
Ill probably just replace each value manually until I find a solution, since moving the values into the :app gradle and removing $rootProject should solve the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant