> For the complete documentation index, see [llms.txt](https://chat-sdk.gitbook.io/chat-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chat-sdk.gitbook.io/chat-sdk/guides/best-practices-and-troubleshooting.md).

# Best Practices and Troubleshooting

There are always random issues that come up using any library. If Chat SDK is not working it's worth checking this list:

### Android

#### I can send messages but not receive

If this happens, it means that the Chat SDK has not setup the required listeners. Internally, that means that `ChatSDK.auth().authenticate().subscribe()` has not been called. A way to get around this is to call this method after your app has authenticated with Firebase.

#### Unable to start activity ComponentInfo {...}

If the app is crashing when trying to start a Chat SDK activity, it's possible that you have created a layout file with the same name as one of the Chat SDK layout files. It is best practice to make sure the layout files are unique. You can do this by adding a prefix. If your project was called "Hello World" you could prefix your layout files with `hw` so `hw_activity_chat` for example.

### App hangs after registration or login / Read and write not working

It can be that when you update the Google-Services.json file this change isn't picked up by Android studio. Delete the build folder and it will work.&#x20;

### iOS

#### Missing Header Files - SomeHeaderFile.h could not be found

Please make sure you have `use_frameworks!` in your `Podfile`.

If it still doesn't work you can clean Xcode then delete the following: Pods directory, .xcworkspace file and `Podfile.lock`. Run `pod deintegrate`. Clear the Xcode derived data and then run `pod update`. This will resolve any Cocoapods caching issues.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://chat-sdk.gitbook.io/chat-sdk/guides/best-practices-and-troubleshooting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
