Troubleshooting

The most frequent issues occurring during integration:

General

chevron-rightCould not determine the dependencies of task ':freerasp-react-native:compileDebugAidl'hashtag

Solution:

  • In package.json, update react-native to a higher patch version and run npm install (or yarn install).

  • See this issuearrow-up-right to find out which patch version is relevant for you.

chevron-rightInvalid hook call. Hooks can only be called inside of the body of a function component.hashtag

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:

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.

Android Devices

chevron-rightExecution failed for task ':freerasp-react-native:minifyReleaseWithR8'.hashtag

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 Trackerarrow-up-right, which also contains additional information about the issue.

iOS Devices

chevron-rightUnsupported Swift architecturehashtag

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:

#ifndef TALSECRUNTIME_SWIFT_H
#define TALSECRUNTIME_SWIFT_H

For more general issues or questions, visit FAQ page. You can also check out the Issues section of our GitHub repositoryarrow-up-right, where you can report issues and view existing reports.

Last updated