Search code examples
androidreactjsreact-nativereact-native-ble-plx

build fails after installing react-native-plx


I am setting up bluetooth on my react native app but i keeep on bumping into this error when i install the react-native-ble-plx module

* What went wrong:
Execution failed for task ':react-native-ble-plx:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':react-native-ble-plx:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: C:\Users\User\AppData\Local\Android\Sdk\platforms\android-34\core-for-system-modules.jar.
         > Error while executing process C:\Program Files\Java\jdk-21\bin\jlink.exe with arguments {--module-path C:\Users\User\.gradle\caches\transforms-3\393400499b2af28f59d755a5f301569b\transformed\output\temp\jmod --add-modules java.base --output C:\Users\User\.gradle\caches\transforms-3\393400499b2af28f59d755a5f301569b\transformed\output\jdkImage --disable-plugin system-modules}

this is a react native app which uses typescript and android studio for emulation. i have tried a number of sources including documentation.


Solution

  • I found a solution. i was using jdk21 so i had to remove it and use jdk17 instead