Gson cannot be resolved to a type error randomly started appearing
i have this method that loads a json file into a class, which i dont exactly know it started throwing an error at this line
Gson gson = new Gson();
despite me not touching that function or the Util function. The wierd part is that if i rewrite that function in a runnable class like
it works. so i can say its not an issue with imports or my util function4 Replies
⌛
This post has been reserved for your question.
Hey @asdru! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
What's the error?
i solved it by writing this instead
return new Gson().fromJson(Utili.leggiFileJson("partite", Integer.toString(id)), Partita.class);
though its very yucky and have no idea why it works💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.