Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type

Have been facing this error after migrating to AndroidX.

java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type: ErrorScope{Error scope for class <ERROR CLASS> with arguments: org.jetbrains.kotlin.types.IndexedParametersSubstitution@14ac19e7} 

This link does not help much

like image 753
Shahzeb Avatar asked Jan 14 '19 11:01

Shahzeb


2 Answers

For me, the error was appearing due to invalid import statement. Android Studio didn't show anything regarding the same. I had to go to every single file, then studio shown the invalid import error. Fixed it and the build error's gone.

like image 196
theapache64 Avatar answered Sep 20 '22 09:09

theapache64


I updated to Kotlin 1.3.20 but it still did not work. Then I decided to check the Kotlin source code. I found this link

I had an interface called DisplayItem<T> and I removed its type parameter. After this, I started to get the error. Actually, at the end of the error in logcat it says DisplayItem

So i checked all DisplayItem types in code and I found I forgat to remove one type parameter in a LiveData variable like the follwoing:

MediatorLiveData<DataHolder<List<DisplayItem<MessageViewEntity>>>> 

After removing type parameter from the variable it started to compile. I hope this'll help you.

Note: You can use git grep for a quick search.

like image 36
savepopulation Avatar answered Sep 17 '22 09:09

savepopulation