Gradle Build Failed #4922
-
Operating SystemWIndows Android Studio VersionElectric Eel RAM size8 Free disk space80GB Which step are you stuck on?Followed all the process written here. Still this error pops up. Error Log> Task :utility:kaptGenerateStubsDebugKotlin FAILED
Execution failed for task ':utility:kaptGenerateStubsDebugKotlin'.
> Could not resolve all files for configuration ':utility:debugCompileClasspath'.
> Failed to transform model.jar (project :model) to match attributes {artifactType=android-classes, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.version=15, org.gradle.libraryelements=jar, org.gradle.usage=java-api}.
> Execution failed for JetifyTransform: E:\Android\open-source\oppia-android\model\build\libs\model.jar.
> Failed to transform 'E:\Android\open-source\oppia-android\model\build\libs\model.jar' using Jetifier. Reason: Unsupported class file major version 59. (Run with --stacktrace for more details.)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Approaches already used to resolve the issueDeleted the project and re-imported from github. Additional informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Hey @Chandra-Sekhar-Bala, are you updating the Kotlin or SDK version while project set up? Thank You. |
Beta Was this translation helpful? Give feedback.
-
@Chandra-Sekhar-Bala If your query is solved please mark it as an answer to the above comment. So that it is helpful to others in the community. Otherwise, we have to mark this discussion as |
Beta Was this translation helpful? Give feedback.
This issue is related to our use of jetifier currently. I believe it will be resolved with the upcoming build platform changes, but to explain a bit:
In gradle.properties,
android.enableJetifier=true
automatically converts third-party libraries to use AndroidX.The maximum supported major version for jetifier class file format in Android is 58, which corresponds to Java 14.
The
model.jar
was compiled with Java 15/major version 59, hence the incompatibility.A fix would be to compile the JAR file with a lower version of Java.
@InquisitiveCatherine can you please check using https://developer.android.com/studio/intro/studio-config#jdk.
Solution by - @adhiamboperes
Edited to add: looks like …