google-developer-training / android-basics-kotlin-sql-basics-app

Fundamentals of relational databases and practice running SQL queries with Database Inspector in Android Studio.
Apache License 2.0
62 stars 128 forks source link

Gradle is not up to recent versions #69

Open Random0Kid0Kaushik opened 2 days ago

Random0Kid0Kaushik commented 2 days ago

When i pulled this repo into my Android Studio, I was warned gradle build was not up to par. I reran the build after upgrading it to 8.5.

Random0Kid0Kaushik commented 2 days ago

I upgraded the gradle and tried re running, here is the issues that I face now.

java.lang.IllegalAccessError: superclass access check failed: class org.jetbrains.kotlin. kapt3. base. javac. KaptJavaCompiler (in unnamed module @0x579483de) cannot access class com.sun.tools.javac. main. JavaCompiler (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac. main to unnamed module @0x579483de

and

Internal compiler error.

Random0Kid0Kaushik commented 2 days ago

Rebuilding the project. (Failed)

Invalidating Caches and Restarting (Failed)

Random0Kid0Kaushik commented 2 days ago

Upgrading dependencies:

Kotlin Coroutines (Android): 1.7.3

Core KTX: 1.15.0

AppCompat:1.7.0

Material Components: 1.12.0

ConstraintLayout: 2.2.0

JUnit (Test): 4.13.2

Android Test JUnit: 1.2.1

Espresso Core: 3.6.1

removed def room_dependencies (all are same version at 2.6.1)

changing kapt "androidx.room:room-compiler:2.6.1" to use ksp "androidx.room:room-compiler:2.6.1"

Random0Kid0Kaushik commented 2 days ago

remaining errors:

'compileSdkVersion' is deprecated (compileSdkVersion 33 --> 34) (Weak error)

Random0Kid0Kaushik commented 2 days ago

New error created: Plugin [idid 'com.google.devtools.ksp'] was not found in any of the following sources.

replaced: id 'com.google.devtools.ksp' with: id 'org.jetbrains.kotlin.ksp' version '1.9.10-1.0.13'

added mavenCentral()

Replacing didn't work. Added version of com.g.d.ksp (1.9.0-1.10) replaced: id 'com.google.devtools.ksp' with: id 'com.google.devtools.ksp' version '1.9.0-1.0.10' apply false

added classpath("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.5.30-1.0.0") to dependencies

dependencies{ /room dependencies/ classpath(...)

//Kotlin Coroutines

didn't. work.

Random0Kid0Kaushik commented 2 days ago

added classpath to wrong build gradle file.

after changing it, new error has been created.

The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.

(I will work on this later, any feedback or help is greatly appriciated)

alan614 commented 2 days ago

I made some updates on the gradle dependencies in this pull request: https://github.com/google-developer-training/android-basics-kotlin-sql-basics-app/pull/68

It might help build with the newer android studios

Random0Kid0Kaushik commented 2 days ago

thank you so much! it does look like we have the same changes to the gradle!

alan614 commented 1 day ago

yeah, don't use ksp, just stick with kapt for now, I can't recall off the top of my head anymore, but I think there's still some compatibility with kotlin with the java version I think it uses