Skip to main content
Version: 1.17.0

Troubleshooting

This section attempts to outline issues that users frequently encounter when first getting accustomed to using react-native-keyboard-controller. These issues may or may not be related to react-native-keyboard-controller.

Incompatible kotlinVersion and failed Android builds

Sometimes you may see failed Android builds complaining that your version of kotlin is lower than expected version.

error: module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.1.

To overcome this issue you will need to set higher version of the kotlin:

react-native or expo bare workflow

You need to modify android/build.gradle and specify correct kotlinVersion:

buildscript {
ext {
kotlinVersion = "1.6.21"
}
}

For more information please, see how it's configured in example project.

Expo managed workflow

If you are using Expo managed workflow you need to install expo-build-properties

npx expo install expo-build-properties

And add plugin inside of your app.json or app.config.js with following configuration:

{
"expo": {
"plugins": [
[
"expo-build-properties",
{
"android": {
"kotlinVersion": "1.6.21"
}
}
]
]
}
}

Swift support

Since part of this library is written using swift language - your project needs to support it. For that you can create empty .swift file with bridging header. See this step-by-step guide if you have problems.

Animations frame drops

Sometimes you may see that animation performance is poor. If you are using sentry@5 make sure enableStallTracking is disabled (i. e. enableStallTracking: false) or upgrade to sentry@6,

See this issue for more details.

MutexLockWithTimeout C++ exception

This exception is thrown when you are trying to use KeyboardProvider or KeyboardAwareScrollView on Android with the new architecture enabled. A top of stacktrace will look like this:

NonPI::MutexLockWithTimeout at line 384 within libc
offset 726000) (std::__ndk1::mutex::lock at line 12 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::Binding::schedulerDidFinishTransaction at line 84 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::Scheduler::uiManagerDidFinishTransaction at line 68 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::UIManager::shadowTreeDidFinishTransaction const at line 64 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::ShadowTree::mount const at line 348 within split_config.arm64_v8a.apk
offset c01000) (facebook::react::ShadowTree::tryCommit const at line 2612 within split_config.arm64_v8a.apk

You have two ways to fix this problem:

Filename longer than 260 characters

If you experience this error on Windows you need to perform next steps:

  1. Download the Latest Version of Ninja

    • Download the latest Ninja release from the official repository
    • Replace the existing ninja.exe in $SDK_PATH$\cmake\$CMAKE_VERSION$\bin with the newly downloaded version
  2. Update the build.gradle File

    • Open android/app/build.gradle
    • Inside the android.defaultConfig block, add the following code:
    externalNativeBuild {
    cmake {
    arguments "-DCMAKE_MAKE_PROGRAM=$YOUR_CMAKE_NINJA_PATH$", "-DCMAKE_OBJECT_PATH_MAX=1024"
    }
    }
    tip

    Make sure to update $YOUR_CMAKE_NINJA_PATH$ with the correct path to your ninja.exe file. For example, it might look something like E:\\SDK\\cmake\\3.22.2\\bin\\ninja.exe on Windows.

  3. Enable Long Path Support in Windows

    • Run the following PowerShell command to enable long path support in Windows:
    New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force