Last time, i got error when trying to parse a JSONObject , then i have found simple mistake during parsing.
It's because i append an "n" at the end of each line here:
while((line = reader.readLine()) != null) {
sb.append(line + "n");
}
then I change to a newline character "\n":
while((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
finally, I solve the problem, hope this may helpful.
Happy Coding !!!
Featured Post
Implementing Hilt in a Kotlin Android Jetpack Compose Project with MVVM Architecture
In modern Android development, maintaining a scalable codebase can be challenging, especially when it comes to dependency management. Hilt,...
Android Tutorials
Home
Android Errors
Android Tutorials
Error parsing data org.json.JSONException: Expected ':' after n in Android or Android Studio