The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files android studio
Asked Answered
A

2

5

There are quite a few questions with the above error, but most of them are related to eclipse, for me it's happening in android studio and also for the project which was working fine till now.

My android project was working fine all the while, and then all of a sudden started getting this build error. Don't know where exactly is the issue, but I see some traces of greendao mentioned in the logs.

FAILURE: Build failed with an exception.

Task :driver_module:greendao FAILED Found 2 problem(s) parsing "/Users/../Code/MyApplication/driver_module/src/main/java/../sdk/MyEvents.java": #0 @1: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files (ID: 16777540; error: true) #1 @1: The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files (ID: 16777540; error: true)

Edit : This is somewhat close I found, but this too didn't work for me. https://github.com/greenrobot/greenDAO/issues/931

Aglimmer answered 6/5, 2021 at 16:52 Comment(2)
I started getting this today, with greendao as well. I updated Android Studio to 4.2 recently. I hope that wasn't the cause.Jara
@eoinzy, Don't think so, I am using 4.1.1 and was planning to update to 4.2 and see if that resolves the error, but seems it doesn't. I am still checking for the solution.Aglimmer
D
12

In my case, I updated greendao-gradle-plugin 3.2.2 to 3.3.0,Then , It resolved magically.

My screenshot

Declass answered 10/5, 2021 at 8:33 Comment(0)
P
5

Confirm what version of the JDK you have set in File > Project Structure > SDK Location. I had the same issue with the embedded JDK from Android Studio, but was able to build by using 1.8 JDK.

Parthia answered 13/5, 2021 at 21:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.