microsoft/rnx-kit

@rnx-kit/react-native-auth causes yarn android to fail.

mark-zacharias opened this issue · 4 comments

What happened?

I'm getting a build error when trying to add react-native-auth to a brand new project.

Is there a dependency that I'm missing?

Affected Package

@rnx-kit/react-native-auth

Version

0.2.3

Which platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • Windows

System Information

System:
  OS: Windows 10 10.0.22621
  CPU: (24) x64 13th Gen Intel(R) Core(TM) i7-13700KF
  Memory: 18.76 GB / 31.82 GB
Binaries:
  Node:
    version: 18.15.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files\nodejs\yarn.CMD
  npm:
    version: 9.5.0
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-221.6008.13.2211.9619390
  Visual Studio:
    - 17.5.33516.290 (Visual Studio Enterprise 2022)
Languages:
  Java: 11.0.18
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.3
    wanted: 0.72.3
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Steps to Reproduce

create a new react native app using 0.72.3
add "@rnx-kit/react-native-auth": "^0.2.3"
running yarn android gives the following error

Plugin [id: 'org.jetbrains.kotlin.android'] was not found in any of the following sources

Code of Conduct

  • I agree to follow this project's Code of Conduct
tido64 commented

Do you have the Kotlin plugin in your build.gradle?

     dependencies {
         classpath("com.android.tools.build:gradle")
         classpath("com.facebook.react:react-native-gradle-plugin")
+        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21")
     }

May I ask what you're using this module for? I'm just wondering if there are use cases outside of Microsoft that we haven't accounted for.

Thanks that was the missing piece so that the build can succeed. I'll can now take a look at implementation.
I'm looking for a solution to help login to Azure AD B2C. I've used @azure/msal-react in the past for react apps and found this library for using in react-native apps.

Is this particular library more intended for internal use?

tido64 commented

@rnx-kit/react-native-auth mostly provides a JS interface for fetching an auth token. You typically implement your native module by extending this package. An example of this is @rnx-kit/react-native-test-app-msal which implements MSAL as the backend for this interface. We mostly use the latter package for our internal example apps though, so it's never been used in production. @rnx-kit/react-native-auth is used in production, but not as is.