> For the complete documentation index, see [llms.txt](https://docs.talsec.app/freerasp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talsec.app/freerasp/freerasp/integration/react-native/troubleshooting.md).

# Troubleshooting

The most frequent issues occurring during integration:

#### General

<details>

<summary>Could not determine the dependencies of task ':freerasp-react-native:compileDebugAidl'</summary>

**Solution:**

* In `package.json`, update `react-native` to a higher patch version and run `npm install` (or `yarn install`).
* See [this issue](https://github.com/facebook/react-native/issues/35210) to find out which patch version is relevant for you.

</details>

<details>

<summary>Invalid hook call. Hooks can only be called inside of the body of a function component.</summary>

**Reason:** The `useFreeRasp` Hook cannot be called inside `useEffect`.

**Solution:**

* If you want to initialize freeRASP inside `useEffect`, you have to handle the initialization on your own. Such inititialization would look like this:

```tsx
import {
  setThreatListeners,
  talsecStart,
  removeThreatListeners,
} from 'freerasp-react-native';

...

useEffect(() => {
  setThreatListeners(actions);
  talsecStart(config);

  return () => {
    removeThreatListeners();
  };
}, []);
```

Where `actions`, `config` are objects described in the integration guide.

</details>

#### Android Devices

<details>

<summary>Execution failed for task ':freerasp-react-native:minifyReleaseWithR8'.</summary>

`Sealed classes are not supported as program classes when generating class files.`

**Reason:** Kotlin sealed classes are not supported in AGP 8.1 used by some versions of RN (currently 0.73.x)

**Solution:** Follow [this comment on Google Issue Tracker](https://issuetracker.google.com/issues/227160052#comment37), which also contains additional information about the issue.

</details>

#### iOS Devices

<details>

<summary>Unsupported Swift architecture</summary>

**Reason:** The arm64 macro is not set under Rosetta.

**Solution:** Go to `<your_project>/node_modules/freerasp-react-native/ios/TalsecRuntime.xcframework/ios-arm64/TalsecRuntime.framework/Headers/TalsecRuntime-Swift.h` and move the following code (lines 4 and 5 in the file) to the top of the file:

```c
#ifndef TALSECRUNTIME_SWIFT_H
#define TALSECRUNTIME_SWIFT_H
```

</details>

For more general issues or questions, visit [FAQ](/freerasp/freerasp/faq.md) page. You can also check out the [Issues section of our GitHub repository](https://github.com/talsec/Free-RASP-ReactNative/issues?q=is%3Aissue), where you can report issues and view existing reports.


---

# 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://docs.talsec.app/freerasp/freerasp/integration/react-native/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.
