android-testing icon indicating copy to clipboard operation
android-testing copied to clipboard

[Codelab Issue] Testing Codelab 5.1#, Step 3# - The code from "starter_code" branch is not building in Android Studio, Flamingo.

Open Suparna-here opened this issue 2 years ago • 7 comments

Describe the problem The code from "starter_code" branch is not building in Android Studio, Flamingo.

In which lesson and step of the codelab can this issue be found? 5.1(Test Basics), step 3(Getting Started).

How to reproduce? Imported the starter_code in Android Studio Flamingo | 2022.2.1 Patch 2 However, the Build fails.

Versions

  1. Imported the starter_code in Android Studio Flamingo | 2022.2.1 Patch 2

Additional information Update Gradle Plugin, Android Gradle Plugin, and target SDK version to 33. Still not building successfully

codelab: advanced-android-kotlin

Suparna-here avatar Jul 08 '23 16:07 Suparna-here

The same for me. I tried both updating Gradle version to support my Java 17 version and downgrading Java version to 16 to support project's Gradle version. This fix probably didn't help https://github.com/915dbfl/advanced-android-testing/commit/c70365a3f553d6052825ceeb22e055a64d8d3859. I get java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x65522ea3) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x65522ea3

CyxouD avatar Sep 05 '23 08:09 CyxouD

Yes, I am having the same issue. please fix it

kgopalan-droid avatar Sep 21 '23 03:09 kgopalan-droid

Temporary fix I found was under File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle and setting the Gradle JDK field to JDK 11

Milksoplimit avatar Nov 16 '23 03:11 Milksoplimit

  • Set JDK field to JDK 15
  • Update RoomVersion to 2.4.0

I am using Apple M2 Pro chip, it worked for me

mrfatworm avatar Nov 27 '23 09:11 mrfatworm

I had to update version of com.android.tools.build:gradle to 7.0.4, and then worked fine.

Kazoroo avatar Dec 17 '23 10:12 Kazoroo

Looks like it is more broken with Iguana, no solution is working for me Getting the following error

Could not compile initialization script 'C:\Users\X\AppData\Local\Temp\ijMapper1.gradle'.
> startup failed:
  General error during conversion: Unsupported class file major version 61
  
  java.lang.IllegalArgumentException: Unsupported class file major version 61

FlyingBackdoor avatar Mar 27 '24 08:03 FlyingBackdoor