Gurupreet / ComposeCookBook

A Collection on all Jetpack compose UI elements, Layouts, Widgets and Demo screens to see it's potential
MIT License
6.3k stars 799 forks source link

Build Failed When Trying to Run the Project #87

Closed wiryadev closed 3 years ago

wiryadev commented 3 years ago

Describe the bug I try to get latest version of this project from version control using master branch. But when i tried to run it, it shows multiple error. I have not tried with use the latest canary.

Android Studio Arctic Fox | 2020.3.1 Beta 4 Build #AI-203.7717.56.2031.7435690, built on June 8, 2021 Runtime version: 11.0.10+0-b96-7249189 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation Windows 10 10.0

To Reproduce Steps to reproduce the behavior: Import from version control and use the master branch

Logcat The complete log can be seen here (using stacktrace)

Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x26ef8ef9) 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 @0x26ef8ef9
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x26ef8ef9) 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 @0x26ef8ef9

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context I tried to downgrade the gradle to 7.0.0-beta04 but still havent solved the problem

OussamaHaff commented 3 years ago

Hello @wiryadev

Thank you for the detailed insights.

The project should compile correctly when using Android Studio Bumblebee Canary 02 or by using only the command line by running the gradle task assembleDebug

Can you try these means please ?

wiryadev commented 3 years ago

I havent tried canary yet (still downloading), but this is what i get by using command line in Arctic Fox Beta 4: image

wiryadev commented 3 years ago

Hello @wiryadev

Thank you for the detailed insights.

The project should compile correctly when using Android Studio Bumblebee Canary 02 or by using only the command line by running the gradle task assembleDebug

Can you try these means please ?

Update: i tried it using Canary 2, gives me the exact same error as the original post. image

OussamaHaff commented 3 years ago

What about using only the command line without Android Studio ?

wiryadev commented 3 years ago

What about using only the command line without Android Studio ?

Sorry but it doesnt work too. Here is the stacktrace: pastebin

image

Gurupreet commented 3 years ago

@hfrsoussama Yes it's the same happening to me could it be something incompatible with latest bumblebee canary 2.1

Gurupreet commented 3 years ago

https://stackoverflow.com/questions/67410992/upgrading-android-kotlin-version-to-1-5-0-throwing-error-message-on-build

But we are not using any dagger dependency.

Gurupreet commented 3 years ago

If you are still facing this issue please go to Android studio preferences and make sure you have correct Gradle JDK selected. I think bumblebee caused this switching JDK automatically.

Screenshot 2021-06-24 at 11 10 35 PM
wiryadev commented 3 years ago

image

Yes, i just tried this and it solves the issue. (previously i used Java 16)